Question 1
In a balanced binary search tree with n elements, what is the worst-case time complexity of reporting all elements in the range [a,b]? Assume that the number of reported elements is k.
Θ(log n)
Θ(log(n)+k)
Θ(k log n)
Θ(n log k)
Question 2
A binary search tree T contains n distinct elements. What is the time complexity of picking an element in T that is smaller than the maximum element in T?
Θ(nlogn)
Θ(n)
Θ(logn)
Θ(1)
Question 3
50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24The number of nodes in the left subtree and right subtree of the root respectively is
Question 5
Question 6
The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16 What is the height of the binary search tree ?
3
4
5
6
Question 7
Question 8
A binary search tree is used to locate the number 43. Which one of the following probe sequence is not possible?
61, 52, 14, 17, 40, 43
10, 65, 31, 48, 37, 43
81, 61, 52, 14, 41, 43
17, 77, 27, 66, 18, 43
Question 9
Question 10
Access time of the symbol table will be logarithmic if it is implemented by
Linear list
Search tree
Hash table
Self organization list
There are 41 questions to complete.