单选题
Java
题号 #2590448
假设用-个长度为50的数组(数组元素的下标从0到49)作为栈的存储空间,栈底指针bottom指向栈底元素,栈顶指针top指向栈顶元素,如果bottom=49,top=30(数组下标),则栈中具有的元素个数为( )。
参考答案
B
答案解析
当前栈中的所有元素的个数就是用栈底指针减去栈顶指针。
你可能感兴趣的试题
A.System.out.println{"");
B.System.out.println{"*");
C.System.out.println{"/"};
D.System.out.println{"\"");