Question 1
What does a leaf node in a tree represent?
A
The root of the tree
B
A node with maximum depth
C
A node with no children
D
A node with two children
Question 2
What is the height of a tree with a single node?
A
0
B
1
C
-1
D
Depends on implementation
Question 3
What is the time complexity of searching for an element in an unsorted array?
A
O(1)
B
O(log n)
C
O(n)
D
O(n^2)
Question 4
What is the time complexity to build a heap from an array of n elements?
A
O(log n)
B
O(n)
C
O(n log n)
D
O(n^2)
Question 5
Which algorithm is used to find the Minimum Spanning Tree?
A
Kruskal's
B
Bellman-Ford
C
Floyd-Warshall
D
Dijkstra's