Data Structures & Algorithms I
Final Assessment (Qns & Ans)
2025
General Instructions
1. Read All Questions Carefully: Make sure you understand each question.
2. Time Management: You have a specific amount of time to complete the exam.
Keep an eye on the clock and pace yourself.
3. Allowed Materials: Only use materials that are explicitly allowed. Unauthorized
materials can lead to disqualification.
4. ANS Format: Follow the required format for your ANS. For example, multiple-
choice questions might need you to select the best ANS, while essay questions
require detailed responses.
5. Academic Integrity: Adhere to the university's honor code. Any form of cheating or
plagiarism is strictly prohibited.
6. Technical Requirements: Ensure your computer and internet connection are
stable. For online exams, you might need a webcam and microphone for proctoring
purposes.
7. Submission: Submit your ANS before the time expires. Late submissions might
not be accepted.
©2024/2025
,1. Which of the following is the primary purpose of a hash
table?
A) Sorting elements
B) Storing ordered collections
C) Providing fast access to data based on keys
D) Implementing a queue
ANS: C
Rationale: Hash tables are designed to provide rapid
insertion, deletion, and search operations using keys.
2. What is the time complexity of searching for an element in a
balanced binary search tree (BST)?
A) O(n)
B) O(log n)
C) O(n log n)
D) O(1)
ANS: B
Rationale: In a balanced BST, the height is log(n), and
operation complexity is therefore O(log n).
©2024/2025
,3. In a Fibonacci heap, which operation can achieve a time
complexity of O(1)?
A) Decrease key
B) Extract minimum
C) Insert
D) Meld
ANS: C
Rationale: Insertion in a Fibonacci heap is O(1) due to its
lazy nature; other operations may exhibit higher complexities.
4. Which of the following data structures allows for efficient
retrieval and modification of an element with a given priority?
A) Array
B) Stack
C) Queue
D) Priority Queue
ANS: D
Rationale: Priority queues support efficient retrieval and
modification of elements based on priority.
5. What is the worst-case time complexity for the insertion
operation in a Red-Black Tree?
©2024/2025
, A) O(n)
B) O(n log n)
C) O(log n)
D) O(1)
ANS: C
Rationale: Red-Black trees maintain balance, ensuring O(log
n) complexity for insertion.
Fill-in-the-Blank Questions
6. The algorithm primarily used for finding the shortest path in a
weighted graph is known as __________.
ANS: Dijkstra's Algorithm
Rationale: Dijkstra's Algorithm efficiently finds the shortest
path in graphs with non-negative weights.
7. In a depth-first search (DFS), the traversal of a graph involves
the use of a __________.
ANS: Stack
Rationale: DFS uses a stack data structure (either explicitly
or via recursion) to keep track of vertices to explore.
©2024/2025