Step 1: Insert keys 6 & 1

Rotate to the Root

Step 2: Insert key 18

Rotate to the Root

Step 3: Insert key 7

Rotate to the Root

Step 4: Insert key 15

Rotate to the Root
Which is Required Binary Search Tree
Red-black binary search tree
Step 1: Insert keys 12 & 5

Step 2: Insert key 23

Step 3: Insert key 9

Node and parent are both red Uncle of node is red push blackness down from grandparent

Root of the tree is Red.Color it black

Step 4: Insert key 19

Step 5: Insert key 2

Step 6: Insert key 21

Node and parent are both red Node is right child, parent
is left child so perform Single Rotate left
Node and parent are both red Node is left child, parent is left child can fix Extra redness by perform Single Rotate Right

Step 7: Insert key 18

Node and parent are both red Uncle of node is red push blackness down from grandparent

Step 8: Insert key 7

Node and parent are both red Uncle of node is red push blackness down from grandparent

Which is Required Red-black binary search tree
Starting with an empty binary search tree, insert each of the following keys and rotate it...
PROBLEM 6: Suppose we insert keys below into an initially empty binary search tree in the given order 6, 9, 2, 1, 5, 7, 10, 8, 3,4 (a) Draw the resulting binary search tree. (b) List the keys according to: A pre-order traversal An in-order traversal A post-order traversal (c) Now we perform some deletions using the "deletion by copying" strategy in which promoted keys are always drawn from a node's right subtree (so that there is only one correct...
PROBLEM 6: Suppose we insert keys below into an initially empty Vanilla binary search tree in the given order: 6, 9, 2, 1, 5, 7, 10, 8, 3, 4 (a) Draw the resulting binary search tree. (b) List the keys according to: A pre-order traversal An in-order traversal A post-order traversal (c) Now we perform some deletions using the “deletion by copying” strategy in which promoted keys are always drawn from a node’s right subtree (so that there is only...
Use the following integer keys and insert into a binary search tree. Display the final binary search tree after all integer keys are inserted. 50, 25, 12, 75, 45, 48, 60, 55, 85, 5, 100, 35, 47, 70, 58, 30, 38, 65, 49, 80
Suppose you started with an empty binary search tree. We've seen previously that inserting the keys 1, 2, 3, 4, 5, 6, 7 (in that order) would lead to a binary search tree whose shape we called degenerate. Propose a second ordering of the same keys that would also lead to a degenerate-shaped binary search tree. If possible, propose a third ordering of the same keys that would also lead to a degenerate-shaped binary search tree. If there are no...
Tree & Hash Table & Heap Use the following integer keys 73, 58, 91, 42, 60, 130, 64, 87 to perform the followings: a) Binary Search Tree - Draw a binary search tree - Retrieve the integers keys in post-order - Retrieve the integers keys in pre-order - Draw a binary search tree after node 58 is deleted b) Create a Hash Table using the methods described below. Show the final array after all integer keys are inserted. Assumes that...
in python
11.1 Binary Search Tree In this assignment, you will implement a Binary Search Tree You will also need to implement a Node class. This class will not be tested, but is needed to implement the BST. Your BST must implement the following methods. You are free to implement additional helper methods. It is recommended you create your own helper methods Constructor: Creates an Empty Tree String Method: Returns the string "Empty Tree" for an empty tree. Otherwise, returns...
Database Management System 5. Starting with an empty B+ tree with up to two keys per node; show how the tree grows when the following keys are inserted one after another: 18, 10, 7, 14, 8, 9, 21
Draw the perfect skip list that results when you insert items with the keys 19, 6, 26, 9, 2, 12, 25, 7, 21 and 17 in that order into an initially empty perfect skip list. Draw the randomized skip list that results when you insert items with the keys 19, 6, 26, 9, 2, 12, 25, 7, 21 and 17 in that order into an initially empty randomized skip list. Compare the binary search tree with the perfect skip list...
A Binary Search Tree is a binary tree where nodes are ordered in the following way: each node contains one key (also known as data) the keys in the left subtree are less than the key in its parent node the keys in the right subtree are greater than the key in its parent node duplicate keys are not allowed Create a Binary Search Tree inserting the following list of numbers in order from left to right. 10, 6, 4, 8, 18, 15, 21 Please type...
Consider the binary search tree created by inserting to empty tree the data in the following order: 15, 16, 4, 7, 2, 1, 3, 8, 10