Question

1- Insert in the given order the following values into an intially empty 2-3-4 tree: 100,...

1- Insert in the given order the following values into an intially empty 2-3-4 tree: 100, 200, 300, 400, 500, 600, 700, 110, 120, 130, 800, 750, 690. Show how the tree evolves after each value is inserted. In other words, draw a picture of the tree after each insertion.

2- Insert the same sequence as above into an initially empty red-black tree. Again draw a picture of the tree after each insertion, and indicate which rotations and/or color flips were performed.

Submit a SINGLE document (Word, PDF, or high quality scan) containing your solution,

0 0
Add a comment Improve this question Transcribed image text
Answer #1

2-3-4

Lav 200 260 (00 001 130 flO lto 国ㄧ面で ⓑ l@de)RED BLACK

2B 1100 block un clo FO clock S00 COD 3 Slack andla fo0) sJock k andl 730 K. tu 200 leco2o0 2 Ped uncio 200 20) lp 13 8 e. f o6 ItO Lt0 7S

Add a comment
Know the answer?
Add Answer to:
1- Insert in the given order the following values into an intially empty 2-3-4 tree: 100,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • (a) On an initially empty red-black tree, perform the following operations in this order: insert(1), insert(3),...

    (a) On an initially empty red-black tree, perform the following operations in this order: insert(1), insert(3), insert(5), insert(6), insert(7), delete(1) Show all the intermediate steps of your work (b) We can get another sorting algorithm by first inserting all the keys into a red-black tree, and then performing an in-order traversal of the tree. What's the time complexity of this algorithm? (As always, use O or Θ notation.)

  • 11. In the 2-3 tree given below (i.e., NOT a 2-3-4 tree), execute insert(28), insert(99), and...

    11. In the 2-3 tree given below (i.e., NOT a 2-3-4 tree), execute insert(28), insert(99), and insert(58), in that order, making sure to rebalance after each insertion. Draw the resulting 2-3 tree after executing these operations. 45 20 70 30 60 80 90 2(4(10 11) (25) (40) (50 55) (65) (71 75)(85) (92 96

  • Starting with an empty binary search tree, insert each of the following keys and rotate it...

    Starting with an empty binary search tree, insert each of the following keys and rotate it to the root in the specified order: 6   1   18   7   15 Starting with an empty red-black binary search tree, insert the following keys in order:: 12   5   23   9   19   2   21   18   7 Show the tree immediately after you insert each key, and after each time you deal with one of the book's cases 1, 2, or 3 (that is, if dealing with one case leads to another, show the additional case as a...

  • 2. a) Consider the following AVL Tree. 50 / 25 75 10 Insert the following values...

    2. a) Consider the following AVL Tree. 50 / 25 75 10 Insert the following values in the given AVL Tree, one after another, and show the resulting tree after each insertion. You must justify your answer by explaining the rotation operation you performed during insertion. 17 40 10 90 5 100 b) Delete the root of the resulting tree in Question 2.a. Show the resulting AVL Tree. Justify your answer by showing every step during deletion.

  • 5. Submission Take an empty B-tree of order 3. Take into 4 2-digit integers. Insert each of these 2-digit numbers in...

    5. Submission Take an empty B-tree of order 3. Take into 4 2-digit integers. Insert each of these 2-digit numbers in the order in which they appear in your student number into the empty heap. Then insert the values 10, 30, 50 70, 90. For your solution, write out the B-tree after each insertion. your student number and split it Example If your student number was 40260833, your solution would look something like the following. The o-->here indicates a child...

  • The keys of value N, N-1, N-2,.., 4, 3, 2, 1 are inserted in this order in a splay tree. What is ...

    The keys of value N, N-1, N-2,.., 4, 3, 2, 1 are inserted in this order in a splay tree. What is the final configuration of the tree? What is the cost in Big-Oh notation of each insert operation? Assume now that the next 100 operations will be a mix of only Find(1), Find(2) and Find(3), i.e., search in the tree for either the key of value 1, or the key of value 2, or the key of value 3....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT