Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

CMPE 187 Practice Midterm #1: 115+ Questions on Data Structures, Recursion & Linked Lists (2026 Update)

Rating
-
Sold
-
Pages
63
Grade
A+
Uploaded on
15-04-2026
Written in
2025/2026

115+ practice midterm questions with detailed rationales covering Stacks, Queues, Recursion, Linked Lists, Generics, and Threading for CMPE 187. This study guide is designed for computer science students preparing for midterms on Data Structures and Algorithms. Includes high-yield questions on LIFO/FIFO, Towers of Hanoi complexity, LLNode implementation, Comparable vs. Comparator, race conditions, and DJW ArraySortedList methods. Each answer includes a clear explanation to reinforce ADT principles. Updated for the 2026 academic cycle.

Show more Read less
Institution
Course

Content preview

1|Page


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.

Written for

Course

Document information

Uploaded on
April 15, 2026
Number of pages
63
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$25.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
itsjerestuviaguide

Get to know the seller

Seller avatar
itsjerestuviaguide Teachme2-tutor
Follow You need to be logged in order to follow users or courses
Sold
2
Member since
4 months
Number of followers
1
Documents
792
Last sold
3 weeks ago
ALL KINDS OF EXAMS SOLUTIONS TESTBANKS, SOLUTION MANUALS & ALL EXAMS SHOP!!!!

Welcome to your ultimate academic resource center! We provide an extensive collection of verified test banks, solution manuals, and practice exam materials for a wide range of courses and textbooks. Our resources are designed to be powerful study aids to help you: Master complex concepts through step-by-step solutions. Test your knowledge and identify key areas for review. Prepare with confidence using practice questions that mirror exam formats. Think of our materials as your personal study partner—giving you the tools to practice effectively, understand deeply, and walk into every exam fully prepared. Browse our catalog to find the perfect resource for your course!

Read more Read less
0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions