CMPE 187 PRACTICE MIDTERM #1: 115+
QUESTIONS & ANSWERS WITH RATIONALES –
DATA STRUCTURES (2026 UPDATE) RATED A+
## Table of Contents
| Section | Topic Area | Question Numbers |
|---------|------------|------------------|
| **Section 1** | Stacks, Queues & Deques | 1–20 |
| **Section 2** | Recursion & Algorithm Analysis | 21–40 |
| **Section 3** | Linked Lists & Nodes (LLNode) | 41–60 |
| **Section 4** | Generics & Object Comparison | 61–75 |
| **Section 5** | Threading & Synchronization | 76–85 |
| **Section 6** | Lists & ArrayLists (DJW Implementation) | 86–100 |
| **Section 7** | Mixed High-Yield Review | 101–115 |
---
# SECTION 1: STACKS, QUEUES & DEQUES
## Questions 1–20
,2|Page
**1. What does the acronym LIFO stand for, and which data structure
uses it?**
A. First In First Out – Queue
B. Last In First Out – Stack
C. Last In First Out – Queue
D. First In Last Out – Stack
**Answer: B**
*Rationale:* LIFO means "Last In First Out" and is the defining
property of a stack. Queues use FIFO (First In First Out) .
**2. What does FIFO stand for, and which data structure uses it?**
A. First In First Out – Queue
B. Fast In Fast Out – Stack
C. First In First Out – Stack
D. File In File Out – Deque
**Answer: A**
*Rationale:* FIFO means "First In First Out" and is the defining
property of a queue .
,3|Page
**3. Which operation would be MOST efficient on a stack implemented
as a singly linked list?**
A. Accessing the element at the bottom
B. Removing the top element
C. Finding the middle element
D. Inserting at the bottom
**Answer: B**
*Rationale:* Stacks only allow access at the top. Push and pop are O(1)
operations. Accessing bottom or middle elements violates stack ADT
principles.
**4. A deque (double-ended queue) differs from a standard queue in
that:**
A. Deques only allow FIFO access
B. Deques allow insertion and removal at BOTH ends
C. Deques are always implemented as arrays
D. Deques cannot store generic types
**Answer: B**
*Rationale:* A deque (double-ended queue) allows add/remove
operations at both the front and back ends. A standard queue only allows
enqueue at back and dequeue from front .
, 4|Page
**5. Which statement about the relationship between lists and deques is
correct?**
A. A list is a type of deque with restricted access
B. A deque is a type of list with restricted access
C. Lists and deques are identical in functionality
D. Deques cannot be implemented using arrays
**Answer: B**
*Rationale:* Deques may only add or remove elements at either end,
while lists may do so anywhere. A deque is a list with restricted access
operations .
**6. What is the time complexity of a pop() operation on a properly
implemented stack using a linked list with a top pointer?**
A. O(1)
B. O(n)
C. O(log n)
D. O(n²)
**Answer: A**
*Rationale:* With a top pointer, pop simply moves the pointer to the
next node and returns the old top's contents. No traversal needed.