Data Structures and Algorithms MCQs January 8, 2026July 11, 2024 by u930973931_answers 50 min Score: 0 Attempted: 0/50 Subscribe 1. Which data structure allows deleting data elements from and inserting at both ends efficiently? (A) Stack (B) Deque (C) Queue (D) Tree 2. In a binary search tree, the maximum number of nodes at level ‘k’ is: (A) 2^k – 1 (B) k (C) 2^(k-1) (D) 2^k 3. What is the worst-case time complexity of inserting a new element into the heap? (A) O(1) (B) O(n) (C) O(n log n) (D) O(log n) 4. Which of the following sorting algorithms has the lowest worst-case time complexity? (A) Merge Sort (B) Bubble Sort (C) Selection Sort (D) Insertion Sort 5. Which data structure is used to implement recursion? (A) Queue (B) Stack (C) Array (D) Tree 6. What is the time complexity of finding the shortest path in a weighted graph using Dijkstra’s algorithm? (A) O(V log V) (B) O(V²) (C) O(E log V) (D) O(E + V log V) 7. Which search algorithm requires the data to be in sorted order? (A) Breadth-First Search (B) Linear Search (C) Depth-First Search (D) Binary Search 8. Which of the following is not a stable sorting algorithm? (A) Quick Sort (B) Bubble Sort (C) Merge Sort (D) Insertion Sort 9. What is the time complexity to find the minimum element in a min-heap? (A) O(log n) (B) O(1) (C) O(n) (D) O(n log n) 10. Which data structure is typically used for implementing LIFO behavior? (A) Queue (B) Tree (C) Heap (D) Stack 11. Which traversal gives ascending order in a Binary Search Tree? (A) Postorder (B) Preorder (C) Inorder (D) Level order 12. Which sorting algorithm makes use of the divide and conquer strategy? (A) Bubble Sort (B) Insertion Sort (C) Selection Sort (D) Quick Sort 13. Which data structure is best suited for searching a value in a sorted list? (A) Binary Search Tree (B) Stack (C) Queue (D) Array 14. What is the worst-case time complexity of insertion in a hash table? (A) O(log n) (B) O(1) (C) O(n) (D) O(n log n) 15. Which of the following is not a type of tree traversal? (A) Breadth-First Search (B) Depth-First Search (C) Spanning Tree (D) Inorder Traversal 16. Which data structure efficiently implements recursion? (A) Array (B) Stack (C) Linked List (D) Queue 17. What is the worst-case time complexity of quicksort? (A) O(n) (B) O(n²) (C) O(n log n) (D) O(log n) 18. Which data structure supports LIFO order? (A) Queue (B) Tree (C) Stack (D) Linked List 19. Which sorting algorithm uses divide and conquer? (A) Bubble Sort (B) Insertion Sort (C) Selection Sort (D) Quick Sort 20. What is the average time complexity of binary search? (A) O(log n) (B) O(1) (C) O(n) (D) O(n log n) 21. Which data structure efficiently implements a priority queue? (A) Stack (B) Linked List (C) Tree (D) Heap 22. Which data structure is most suitable for recursion? (A) Stack (B) Array (C) Queue (D) Heap 23. Which sorting algorithm is not stable? (A) Quick Sort (B) Bubble Sort (C) Merge Sort (D) Selection Sort 24. Worst-case time complexity of heapify in a max-heap? (A) O(n) (B) O(log n) (C) O(n log n) (D) O(1) 25. Which sorting algorithm has the best average-case time complexity? (A) Bubble Sort (B) Selection Sort (C) Insertion Sort (D) Merge Sort 26. Worst-case time complexity of deletion in a BST with n nodes? (A) O(n) (B) O(log n) (C) O(n log n) (D) O(1) 27. Which algorithm finds strongly connected components? (A) Dijkstra’s Algorithm (B) Bellman-Ford Algorithm (C) Kosaraju’s Algorithm (D) Prim’s Algorithm 28. Which data structure follows FIFO order? (A) Queue (B) Stack (C) Heap (D) Tree 29. Average time complexity of searching in a hash table? (A) O(n log n) (B) O(log n) (C) O(n) (D) O(1) 30. Which sorting algorithm is not in-place? (A) Merge Sort (B) Quick Sort (C) Bubble Sort (D) Insertion Sort 31. Priority queues are typically implemented using: (A) Stack (B) Heap (C) Queue (D) Linked List 32. Best-case time complexity of bubble sort? (A) O(n²) (B) O(n log n) (C) O(n) (D) O(log n) 33. Which structure supports both DFS and BFS traversal? (A) Tree (B) Stack (C) Queue (D) Heap 34. Which sorting algorithm has the best space complexity? (A) Bubble Sort (B) Insertion Sort (C) Merge Sort (D) Quick Sort 35. Which algorithm handles negative edge weights? (A) Dijkstra’s Algorithm (B) Prim’s Algorithm (C) Bellman-Ford Algorithm (D) Kruskal’s Algorithm 36. Which data structure is not suitable for hash table implementation? (A) Array (B) Stack (C) Binary Search Tree (D) Linked List 37. Time complexity of quickselect (kth smallest)? (A) O(n²) (B) O(n log n) (C) O(n) (D) O(log n) 38. Which is not a binary tree type? (A) AVL Tree (B) Fibonacci Tree (C) B-Tree (D) Red-Black Tree 39. Time complexity of merging two sorted arrays? (A) O(log(m + n)) (B) O(m × n) (C) O(m + n) (D) O(max(m, n)) 40. Which sorting algorithm performs best on already sorted data? (A) Bubble Sort (B) Quick Sort (C) Insertion Sort (D) Merge Sort 41. Worst-case insertion time in a doubly linked list? (A) O(1) (B) O(log n) (C) O(n) (D) O(n log n) 42. Which algorithm finds maximum flow? (A) Kruskal’s Algorithm (B) Dijkstra’s Algorithm (C) Ford-Fulkerson Algorithm (D) Prim’s Algorithm 43. Traversal for non-decreasing order in BST? (A) Inorder (B) Preorder (C) Postorder (D) Level order 44. Best-case time complexity of merge sort? (A) O(n) (B) O(log n) (C) O(n²) (D) O(n log n) 45. Which is not a comparison-based sorting algorithm? (A) Radix Sort (B) Merge Sort (C) Quick Sort (D) Bubble Sort 46. Worst-case deletion time in BST? (A) O(log n) (B) O(1) (C) O(n log n) (D) O(n) 47. Shortest path in an unweighted graph is found using: (A) Dijkstra’s Algorithm (B) Prim’s Algorithm (C) Depth-First Search (D) Breadth-First Search 48. Time complexity of finding kth smallest in a min-heap? (A) O(k) (B) O(log n) (C) O(n) (D) O(log k) 49. Which data structure implements a dynamic set efficiently? (A) Hash Table (B) Stack (C) Heap (D) Queue 50. Worst-case time complexity of insertion sort? (A) O(n²) (B) O(n log n) (C) O(n) (D) O(log n)