100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

CS218 Data Structures & Algorithms Midterm Exam Review 2025 (With Solns)

Rating
-
Sold
-
Pages
25
Uploaded on
08-04-2025
Written in
2024/2025

CS218 Data Structures & Algorithms Midterm Exam Review 2025 (With Solns)CS218 Data Structures & Algorithms Midterm Exam Review 2025 (With Solns)CS218 Data Structures & Algorithms Midterm Exam Review 2025 (With Solns)











Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
April 8, 2025
Number of pages
25
Written in
2024/2025
Type
Exam (elaborations)
Contains
Unknown

Subjects

Content preview

CS218 Data Structures & Algorithms

Midterm Exam Review (Qns & Ans)

2025



1. Which data structure follows the Last-In-First-Out (LIFO)
principle?
A. Queue
B. Stack
C. Linked List
D. Tree
ANS: B. Stack
Rationale: A stack processes data in LIFO order, where the last
element added is the first to be removed.


2. Which algorithm is best suited for finding the shortest path in
a weighted graph?
©2025

, A. Depth-First Search (DFS)
B. Breadth-First Search (BFS)
C. Dijkstra's Algorithm
D. Kruskal's Algorithm
ANS: C. Dijkstra's Algorithm
Rationale: Dijkstra's Algorithm computes the shortest path
efficiently in graphs with positive edge weights.


3. What is the average-case time complexity of Merge Sort?
A. O(n)
B. O(n log n)
C. O(n²)
D. O(log n)
ANS: B. O(n log n)
Rationale: Merge Sort divides the array into subarrays and
merges them, leading to an average-case complexity of O(n log
n).


4. Which data structure is used to implement recursion?
A. Queue
B. Stack

©2025

, C. Heap
D. Hash Table
ANS: B. Stack
Rationale: Recursion relies on the call stack to track function
calls and their execution states.


5. Which traversal method processes nodes in the order: root, left
subtree, right subtree?
A. Inorder traversal
B. Preorder traversal
C. Postorder traversal
D. Level-order traversal
ANS: B. Preorder traversal
Rationale: Preorder traversal visits the root first, followed by
the left and right subtrees.


---


Fill-in-the-Blank Questions
6. A ________ is a data structure used to store elements in
hierarchical order, where each node has at most two children.
ANS: Binary Tree
©2025

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
ClementeO Walden University
View profile
Follow You need to be logged in order to follow users or courses
Sold
128
Member since
3 year
Number of followers
43
Documents
5013
Last sold
2 weeks ago

3.7

16 reviews

5
9
4
0
3
3
2
1
1
3

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

Frequently asked questions