Sample Multiple Choice Exam
Sample Multiple Choice Exam
A. Files
C. Tables
D. Databases
2. Which of the following data structures is NOT typically stored in secondary memory?
A. Linked Lists
B. Files
C. Databases
D. Tables
3. Which data structure uses nodes containing data and references to the next node?
A. Array
B. Stack
C. Linked List
D. Queue
4. Which data structure operates on a Last In, First Out (LIFO) principle?
A. Queue
B. Stack
C. Binary Tree
D. Graph
5. In a binary search tree (BST), where are nodes with keys greater than the root's key
located?
C. At the root
6. Which data structure is used for Breadth-First Search (BFS) in graph traversal?
A. Stack
B. Linked List
C. Queue
D. Binary Tree
7. In a binary search tree, the left subtree of a node contains only nodes with keys ____.
A. Queue
B. Stack
C. Array
D. Graph
9. What is the time complexity of searching for an element in a balanced binary search tree
(BST)?
A. O (1)
B. O (n)
C. O (log n)
D. O (n^2)
A. O(n)
B. O(log n)
C. O(n log n)
D. O(n^2)
11. Which sorting algorithm has the worst-case time complexity of O(n^2) but is often
faster than other algorithms like merge sort or quick sort for small datasets?
A. Bubble Sort
B. Insertion Sort
C. Merge Sort
D. Heap Sort
12. Which of the following statements is true about the binary search algorithm?
13. Which sorting algorithm has an average-case time complexity of O(n log n)?
A. Bubble Sort
B. Quick Sort
C. Insertion Sort
D. Selection Sort
14. Which of the following sorting algorithms is stable and has a worst-case time
complexity of O (n log n)?
A. Quick Sort
B. Merge Sort
C. Heap Sort
D. Bubble Sort
15. Which algorithm is best suited for finding the shortest path in a weighted graph?
C. Dijkstra’s Algorithm
D. Kruskal’s Algorithm
16. What is the primary use of the Economic Order Quantity (EOQ) formula in inventory
management?
17. In text searching, which algorithm is known for its efficiency in finding a substring
within a larger string by preprocessing the pattern?
A. Linear Search
B. Boyer-Moore Algorithm
D. Rabin-Karp Algorithm
18. Which algorithm is known for its efficiency in finding a substring within a larger string
by preprocessing the pattern?
A. Linear Search
B. Boyer-Moore Algorithm
D. Rabin-Karp Algorithm
19. What data structure is primarily used in the Huffman coding algorithm for data
compression?
A. Binary Tree
B. Linked List
C. Stack
D. Priority Queue
B. Space complexity
C. Memory usage
D. Input size
21. If an algorithm has a high variance in performance on different datasets of the same
size, what does this indicate?
A. math
B. random
C. time
D. heapq
23. When designing an algorithm to schedule tasks on multiple machines to minimize total
completion time, which scheduling strategy can be used?
A. First-Come-First-Served
D. Round Robin
24. Which algorithm would be most appropriate for matching a large number of DNA
sequences against a reference genome?
A. Linear Search
C. Dijkstra’s Algorithm
D. Merge Sort
25. In a real-life navigation system, what is the primary purpose of using Dijkstra's
Algorithm?
27. If you need to compress a file effectively to reduce storage space, which algorithm
should you consider implementing?
A. Dijkstra’s Algorithm
B. Quick Sort
C. Huffman Coding
D. Binary Search