Type your text
Type your text
Data Structures and Algorithms Question Bank
Type your text
,Data Structures and Algorithms: Question Bank
I. Multiple Choice Questions (MCQs) (30 Questions)
1. Which of the following is not a basic operation on a data structure?
a) Traversal
b) Insertion
c) Compilation
d) Deletion
Answer: c) Compilation
2. Time complexity of binary search algorithm is:
a) O(n)
b) O(log n)
c) O(n log n)
d) O(n^2)
Answer: b) O(log n)
3. Which data structure uses the LIFO principle?
a) Queue
b) Stack
c) Linked List
d) Array
Answer: b) Stack
4. Which of these is not a type of queue?
a) Simple Queue
b) Circular Queue
c) Priority Queue
d) Binary Queue
Answer: d) Binary Queue
5. What is the space complexity of merge sort?
a) O(1)
b) O(log n)
c) O(n)
d) O(n log n)
Answer: c) O(n)
6. Which of the following traversals is used for expression tree evaluation?
a) Preorder
b) Inorder
c) Postorder
d) Level Order
Answer: c) Postorder
7. Which algorithm is best for sorting large datasets?
a) Bubble Sort
b) Insertion Sort
c) Quick Sort
, d) Selection Sort
Answer: c) Quick Sort
8. Which data structure is used in BFS of graph?
a) Stack
b) Queue
c) Priority Queue
d) Tree
Answer: b) Queue
9. The worst-case time complexity of linear search is:
a) O(1)
b) O(n)
c) O(log n)
d) O(n^2)
Answer: b) O(n)
10. Which of the following trees is height-balanced?
a) Binary Tree
b) AVL Tree
c) Threaded Tree
d) B+ Tree
Answer: b) AVL Tree
11. Which sorting algorithm has the best worst-case performance?
a) Bubble Sort
b) Merge Sort
c) Quick Sort
d) Insertion Sort
Answer: b) Merge Sort
12. Which structure is used to implement recursion?
a) Stack
b) Queue
c) Tree
d) Linked List
Answer: a) Stack
13. What is the in-order traversal of a binary search tree?
a) Sorted order
b) Reverse order
c) Random order
d) Preorder
Answer: a) Sorted order
14. In which tree every internal node has exactly two children?
a) Binary Tree
b) Binary Search Tree
c) Full Binary Tree
d) AVL Tree