1a.
In 3 to 5 sentences, highlight what a splay tree is and how it
works.
1b.
In natural language, describe how to carry out the following
operations in a splay tree.
i. search ii. insert iii. delete
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
A splay tree is just a binary search tree that has excellent performance in the cases where some data is accessed more frequently than others. The tree self-adjusts after lookup, insert and delete operations.
A splay tree does not necessarily have mininum height, nor does it necessarily have logarithmically bounded height. In fact a splay tree may even be degenerate. However, it is based on the idea that if you recently used something you'll likely need it again soon, so it keeps the most commonly used data near the top where it is accessed most quickly.
After each insert, delete, or lookup, you splay:
Note: Brother According to HomeworkLib's policy we are only allowed to answer first part if there are many. So, I request you to post other part as separate posts
Kindly revert for any queries
Thanks.
1a. In 3 to 5 sentences, highlight what a splay tree is and how it works....
In the binary search tree below, carry out the following operations in sequence Add 5, add 17, delete 23, delete 9. 15 23 12 19 21 10
In the binary search tree below, carry out the following operations in sequence Add 5, add 17, delete 23, delete 9. 15 23 12 19 21 10
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....
Q1: How many levels your binary search tree has (including level 0)? Is the binary search tree you created height balanced? 2.1 Click the animations “Binary Search Tree”. Click “Insert” button to insert the following elements in the sequence, “50, 20, 30, 70, 90, 80, 40, 10, 5, 60, 85, 95”. http://algoanim.ide.sk/index.php?page=showanim&id=44 Q2: What is the insertion process of the binary search tree? The new identical element is inserted as left or right child of the existing same value? 2.3...
or 5. 1. Consider the following game tree. In this tree, a player, say Player 3, has an information set with three nodes, I, II, and III in it. Explain whether each of the following is true or false. (a) Node I is Player 3's decision node, but node II is Player 2's decision node. (b) Player 3 has three actions at node III and two at node I (c) Player 3 has exactly two actions at node III, labeled...
Q1: How many levels your binary search tree has (including level 0)? Is the binary search tree you created height balanced? 2.1 Click the animations “Binary Search Tree”. Click “Insert” button to insert the following elements in the sequence, “50, 20, 30, 70, 90, 80, 40, 10, 5, 60, 85, 95”. http://algoanim.ide.sk/index.php?page=showanim&id=44 Q2: What is the insertion process of the binary search tree? The new identical element is inserted as left or right child of the existing same value? 2.3...
need solution plz
Question 1 (CLO-4, PLo-3) Figure 1 show an input tree T. 1. Analyze the tree and mention weather the tree is a heap or not by checking heap's property. If yes, justify your answer. If no, make it a heap by adjusting the node's location 2. Alter the value of T[l1] to 100 using alter-heap algorithm. Analyze the tree again and state whether i. The tree is still a heap or not? ii. If not, which one...
need full solution of this question plz help me
Question 1 (CLO-4, PLo-3) Figure 1 show an input tree T. 1. Analyze the tree and mention weather the tree is a heap or not by checking heap's property. If yes, justify your answer. If no, make it a heap by adjusting the node's location 2. Alter the value of T[l1] to 100 using alter-heap algorithm. Analyze the tree again and state whether i. The tree is still a heap or...
Answer the following i. How many arcs can a tree with 10 nodes have? ii. Give an example of a graph with at least 5 nodes and each node of degree 3. iii. Give an example of a tree with at least 5 nodes. Identify the root and leafs
3. (8 points) Using the implementation of binary search tree operations we discussed in class, draw the trees that result from the following operations: (a) Inserting 142, 400, 205, 127, 100, 320, 160, 141, and 110 into an initially-empty tree (in that order). (b) Deleting 142 from the tree you drew for part (a). 4. (8 points) Draw the unique binary tree that has a preorder traversal of 4, 1, 6, 3, 7, 5, 9, 2, 8 and an inorder...
Part B (BI). Implement a Red-Black tree with only operation Insert(). Your program should read from a file that contain positive integers and should insert those numbers into the RB tree in that order. Note that the input file will only contain distinct integers. Print your tree by level using positive values for Black color and negative values for Red color Do not print out null nodes. Format for a node: <Node_value>, <Parent_value>). For example, the following tree is represented...