14.14 Exercises, Problems, and Projects
14.14.1 Multiple Choice Exercises
-
1. What is an advantage of linked lists over arrays?
❑ Linked lists are easily expanded.
❑ Linked lists are limited in size.
❑ Linked lists can store objects, whereas arrays are limited to primitive data types.
-
2. How is a stack organized?
❑ FIFO
❑ LIFO
❑ Items are sorted in ascending order.
❑ Items are sorted in descending order.
-
3. How is a queue organized?
❑ FIFO
❑ LIFO
❑ Items are sorted in ascending order.
❑ Items are sorted in descending order.
-
4. The following linked list represents a stack. If we pop once from the stack, what item is popped?
( 7, Ajay, NFL ) → ( 3, Sarah, Mario ) → ( 9, Jin, Golf )
head
→ ( 5, Joe, Sonic ...
Get Java Illuminated, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.