Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

.p is referring to the parent of the node procedure Transplant(T,u,v) if u.p == NIL T.root = v else if u == u.p.left u.p.left =

.p is referring to the parent of the node procedure Transplant(T,u,v) if u.p == NIL T.root = v else if u == u.p.left u.p.left = v else u.p.right = v if v != NIL v.p = u.p 
procedure TreeDelete(T,z) if z.left == NIL Transplant(T,z,z.right) else if z.right == NIL Transplant(T,z,z.left) else y = TreeMinimum(z.right) if y.p != z Transplant(T,y,y.right) y.right = z.right y.right.p = y Transplant(T,z,y) y.left = z.left y.left.p = y 

Problem 77. Let T be the following tree. Starting with this tree, show the result of TreeDelete(T,z1) followed by TreeDelete(T,z2). Similarly, show the result of TreeDelete(T,z2) followed by TreeDelete(T,z1). Do the results differ?

 z1 / \ a z2 / \ b c \ / \ d e f 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students also viewed these Databases questions

Question

What is the entry for the down payment from a signed contract?

Answered: 1 week ago