Stacks_P_6 Consider an ArrayStack instance that undergoes the following operations: After all the operations above have been performed in order, answer the following: Part 1: What is the final state of the stack (from bottom of the stack to top)?Part 2: What value would be returned by the last pop() operation shown above? 单项选择题
A
Part1: The stack is now ['apple', 'banana', 'date'], and Part2: the last pop() will return 'date'.
B
Part1: The stack is now ['apple', 'banana', 'date'], and Part2: the last pop() will return 'cherry'.
C
Part1: The stack is now ['apple', 'banana'], and Part2: the last pop() will return 'cherry'.
D
Part1: The stack is now ['apple', 'cherry', 'date'],and Part2: the last pop() will return 'banana'.
登录即可查看完整答案
我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!