Q.
After applying the below operations on a input sequence, what happens?
i. construct a cartesian tree for input sequence
ii. put the root element of above tree in a priority queue
iii. if( priority queue is not empty) then
.search and delete minimum value in priority queue
.add that to output
.add cartesian tree children of above node to priority queue
Similar Questions
1. How do you determine the cost of a spanning tree?
2. In an arbitrary tree ( not a search tree) of order M. Its size is N, and its height is K.
The computation time needed to find a data item on T is
3. What would be the cost value for any answering node of a sub tree with root ‘r’
using branch-bound algorithm?
4. How many nodes are there in a full state space tree with n = 6?
5. How many minimum number of spanning trees, one can have from a given
connected graph with N nodes is having different weights for the edges.
6.
The following formula is of :
left_subtree (keys) ≤ node (key) ≤ right_subtree (keys)
7. Binary search tree has best case run-time complexity of Ο(log n). What could the worst case?
8. In order traversal of binary search tree will produce −
9. In binary heap, whenever the root is removed then the rightmost element of last level is replaced by the root. Why?
10. If we choose Prim's Algorithm for uniquely weighted spanning tree instead of Kruskal's Algorithm, then
DATA STRUCTURE TOPICS