Practice Test questions with answers |\ |\ |\ |\
Which data structure follows the "First-In-First-Out" (FIFO)
|\ |\ |\ |\ |\ |\ |\
principle?
a. Stack
|\
b. Queue
|\
c. Linked List
|\ |\
d. Tree
|\
Queue
Which sorting algorithm has a worst-case time complexity of
|\ |\ |\ |\ |\ |\ |\ |\ |\
O(n^2)?
a. Bubble Sort
|\ |\
b. Merge Sort
|\ |\
c. Quick Sort
|\ |\
d. Insertion Sort
|\ |\
Bubble Sort |\
In a binary search tree (BST), what is the property of the left
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\
child compared to the parent node?
|\ |\ |\ |\ |\
a. It is greater than the parent node.
|\ |\ |\ |\ |\ |\ |\
b. It is less than the parent node.
|\ |\ |\ |\ |\ |\ |\
c. It is equal to the parent node.
|\ |\ |\ |\ |\ |\ |\
d. There is no specific relationship.
|\ |\ |\ |\ |\
It is less than the parent node.
|\ |\ |\ |\ |\ |\
Which data structure provides constant-time average-case
|\ |\ |\ |\ |\ |\
insertion, deletion, and retrieval operations? |\ |\ |\ |\
a. Array
|\
b. Linked List
|\ |\
c. Hash Table
|\ |\
d. Stack
|\
, Hash Table |\
Which algorithm is used to find the shortest path between nodes
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\
in a graph? a. Breadth-First Search (BFS)
|\ |\ |\ |\ |\ |\
b. Depth-First Search (DFS)
|\ |\ |\
c. Dijkstra's Algorithm
|\ |\
d. Bellman-Ford Algorithm
|\ |\
Dijkstra's Algorithm |\
Which data structure uses the "Last-In-First-Out" (LIFO) principle?
|\ |\ |\ |\ |\ |\ |\
a. Queue
|\
b. Heap
|\
c. Stack
|\
d. Hash Table
|\ |\
Stack
Which sorting algorithm has the best average-case time
|\ |\ |\ |\ |\ |\ |\ |\
complexity?
a. Bubble Sort
|\ |\
b. Selection Sort
|\ |\
c. Insertion Sort
|\ |\
d. Quick Sort
|\ |\
Quick Sort |\
Which data structure is based on a hierarchical relationship
|\ |\ |\ |\ |\ |\ |\ |\ |\
between elements? |\
a. Stack
|\
b. Queue
|\
c. Linked List
|\ |\
d. Tree
|\
Tree
Which algorithm is used to traverse a binary tree in an in-order
|\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\ |\
manner?
a. Depth-First Search (DFS)
|\ |\ |\