Full Data Structures Answers
Full Data Structures Answers
Exam Answers
PART – A (10 × 1 = 10 Marks)
Answer all questions.
PART – B (5 × 2 = 10 Marks)
Answer all questions.
11. 11. Difference between best, worst, and average case time complexities:
Best Case – Minimum time (e.g., O(1) in linear search).
Worst Case – Maximum time (e.g., O(n) if element is last).
Average Case – Expected time (e.g., O(n/2) ≈ O(n)).
12. 12. Applications of Stack:
- Expression evaluation and conversion
- Function call management
- Undo operations
- Backtracking algorithms
13. 13. Need for circular queue:
To reuse the space created by dequeued elements and avoid overflow in a linear queue
by connecting rear to front.
14. 14. AVL Tree:
A self-balancing binary search tree where the difference in heights (balance factor) of
left and right subtrees is -1, 0, or +1.
15. 15. Difference between BFS and DFS:
BFS: Level-order traversal using a queue.
DFS: Depth-first traversal using stack or recursion.
PART – C (5 × 12 = 60 Marks)
Answer all questions.