You are on page 1of 1

Balkumari College

Bharatpur,Chitwan
Mid-term Exam
Subject: Data Structure and Algorithm FM:30
Time:1hr 30min PM:15

Group A Attempt all questions 1*4=4 Group A Attempt all questions 1*4=4
1. What is the time complexity of an algorithm that takes 1. What is the time complexity of an algorithm that takes
constant time, regardless of the input size? constant time, regardless of the input size?
2. Mention one situation where a doubly linked list is preferred 2. Mention one situation where a doubly linked list is preferred
over an array. over an array.
3. Explain the concept of enqueuing an element.
4. Why do we prefer self-adjusting trees instead of strict 3. Explain the concept of enqueuing an element into a queue.
balanced tree 4. Why do we prefer self-adjusting trees instead of strict
Group B Attempt any two 2*3=6 balanced tree
5. Illustrate the step-by-step insertion process for the elements Group B Attempt any two 2*3=6
15, 10, 20, 5, and 25 in an initially empty BST. 5. Illustrate the step-by-step insertion process for the elements
6. How does heapify method helps in arranging data in sorted 15, 10, 20, 5, and 25 in an initially empty BST.
order. 6. How does heapify method helps in arranging data in sorted
7. Explain the difference between a linear queue and a circular order.
queue. Discuss the advantages of using a circular queue in 7. Explain the difference between a linear queue and a circular
scenarios where the queue size is fixed. queue. Discuss the advantages of using a circular queue in
Group C Attempt any two 2*5=10 scenarios where the queue size is fixed.
8. Explain the concept of a binary search tree (BST). Provide the Group C Attempt any two 2*5=10
algorithm for inserting a new element into a BST. Show the 8. Explain the concept of a binary search tree (BST). Provide the
different deletion technique of B-Tree algorithm for inserting a new element into a BST. Show the
9. Discuss the operations that can be performed on a queue. different deletion technique of B-Tree
Provide real-world examples where a queue is useful in 9. Discuss the operations that can be performed on a queue.
solving specific problems. Provide real-world examples where a queue is useful in
10. Describe the stack data structure and explain the concept of solving specific problems.
LIFO order. Illustrate the stack operations of push and pop. 10. Describe the stack data structure and explain the concept of
Trace the stack's contents after performing the following LIFO order. Illustrate the stack operations of push and pop.
operations: push 5, push 10, pop, push 15, pop. Trace the stack's contents after performing the following
Group D Attempt all questions 1*10=10 operations: push 5, push 10, pop, push 15, pop.
Group D Attempt all questions 1*10=10
11. Explain all the insertion operations of doubly linked list along
with java function for each of the operation. 11. Explain all the insertion operations of doubly linked list along
with java function for each of the operation.

You might also like