Question: You should perform the actions below on the original tree and show the final tree (each action is independent). Also, indicate which turns are needed

 You should perform the actions below on the original tree and

You should perform the actions below on the original tree and show the final tree (each action is independent). Also, indicate which turns are needed in each case.

a) Enter the 'J' key with priority 2.

b) Delete the 'T' key from the tree.

c) Split the tree into two trees for the key value 'K'.

3.1.1 Definitions A treap is a binary tree in which every node has both a search key and a priority, where the inorder sequence of search keys is sorted and each node's priority is smaller than the priorities of its children.1 In other words, a treap is simultaneously a binary search tree for the search keys and a (min-)heap for the priorities. In our examples, we will use letters for the search keys and numbers for the priorities. M, 4 A treap. Letters are search keys; numbers are priorities

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!