Question: 1 . Sequence of key - values ( 5 , 1 6 , 2 2 , 4 5 , 2 , 1 0 , 1

1.
Sequence of key-values (5,16,22,45,2,10,18,30,50,12,1), insert these key-values (in the given order) into the initially empty (2,4) tree, and with respect to the finally obtained (2,4) tree, which of the following descriptions is not true.
A. There are 4 nodes in total.
B .the root node is the 3-node of 10,22
C .the incremental numbers can be obtained by traversing in the middle order.
D .The height of the (2,4) tree is 2.
2.
If you input a sequence of sorted data, and it takes O(n log n) time to sort it using merge sort and heap sort, how much time will it take if you use insertion sort? What will be the result if this sorted data sequence is reversed?
A. O(n), O(n^2)
B. O(n log n), O(n^2)
C. O(n), O(n log n)
D. O(n log n), O(n log n)
3.
Which of the following descriptions of Breadth-First Search (BFS) is NOT true?
A. It can be used to test whether a graph is connected or not.
B .It can calculate whether there are loops in a graph.
C .It takes time to visit O(n long n)
D .It can calculate the shortest path from the starting point to each vertex.
4.
Consider a tree T storing n data items. If T is a binary search tree, what is the worst-case height of T?
A. n log n
B. n
C. n /2
D. log n
5.
Consider a tree T that stores n data items. If T is a splay tree, what is the worst-case height of T?
A. None of the above
B. n log n
C. log n
D. n

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!