Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Readjusting for tree modification calls for rotations in the binary search tree. Single rotations are possible in the left or right direction for moving a node to the root position. The task would be achieved this way, but the performance of the tree amortized over many accesses may not be good.

Rather, the key idea of splaying is to move the accessed node two levels up the tree at each step. Basic terminologies in this context are:

Zig: Movement of one step down the path to the left to fetch a node up. Zag: Movement of one step down the path to the right to fetch a node up.

With these two fundamental steps, the possible splay rotations are: Zig-Zig: Movement of two steps down to the left.

Zag-Zag: Movement of two steps down to the right. Zig-Zag: Movement of one step left and then right. Zag-Zig: Movement of one step right and then left.

Figure depicts the splay rotations.

Zig:

Zig-Zig:

Zig-Zag:

Splaying may be top-down or bottom-up. In bottom-up splaying, splaying begin at the accessed node, moving up the chain to root. While in top-down splaying, splaying begins from the top while searching for the node to access. In the next section, we would be discussing the top-down splaying procedure:

As top-down splaying proceeds, the tree is split into three parts:

a) Central SubTree: This is initially the complete tree and may contain the target node. Search proceeds by comparison of the target value with the root and ends with the root of the central tree being the node containing the target if present or null node if the target is not present.

b) Left SubTree: This is initially empty and is created as the central subtree is splayed. It consists of nodes with values less than the target being searched.

c) Right SubTree: This is also initially empty and is created similar to left subtree. It contains nodes with values more than the target node.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9536974

Have any Question?


Related Questions in Computer Engineering

When you respond to others discuss ways in which technology

When you respond to others, discuss ways in which technology has changed your outlook on your career of choice.

Question suppose we have a message m 0101011010100001 to

Question : Suppose we have a message m = 0101011010100001 to be transmitted across a network and to protect it from errors, we use the CRC generator polynomial P(x) = x 7 +x 6 +x 2 +x. Answer the following: (a) What is t ...

Question suppose a data packet datagram is sent in the

Question : Suppose a data packet (datagram) is sent in the Internet from a source station (computer) to a destination station. What type of addess (physical, MAC, port address or some other) is used to forward the datagr ...

Tasks1 identify possible actors and use cases involved in

Tasks: 1. Identify possible actors and use cases involved in Personal Trainer's operations. 2. Create an object relationship diagram for the Personal Trainer information system. 3. Create a use case diagram for the syste ...

You work in a veterinarians office and need to organize the

You work in a Veterinarian's office and need to organize the data on pets that you treat. In your database, you want to keep track of the following information: Customer information: Name Address City State ZIP Phone # Y ...

Access your browsers security settings and configure the

Access your browser's security settings and configure the browser to refuse all cookies or to prompt you before allowing a cookie. Restart the browser; then visit several different Web sites. Be sure to visit popular sit ...

Can someone help please i had help but its not working

Can someone help please. I had help but it's not working. PLEASE DO BOTH PARTS! Please make sure to read the entire problem and do both parts PLEASE DO NOT write it out I have a hard time reading people's hand writing pl ...

Question suppose that a web server has a link speed of

Question : Suppose that a web server has a link speed of 1Gbps. And suppose that each machine in a botnet has a link speed of 1Mbps a. How many botnet machines are needed to send data to the web server in order to fill t ...

Starting out with cpp 8th edition pg 449 7 with

Starting out with Cpp 8th edition Pg 449 #7 WITH MODIFICATIONS! Write a program that asks the user for a file name, and then ask the user for up to 100 input values. Write the user input values to the file. Then read the ...

What effect does the teacher have on creating a learning

What effect does the teacher have on creating a learning environment with little to no behavior problems?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As