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