Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Algorithm to Delete Node from Binary Search Tree

To delete a node following possibilities might be arise

Node id a terminal node

Node have only one child

Node having 2 children.

DEL (INFO, LEFT, RIGT, ROOT, AVAIL, ITEM)

A binary search tree T is in memory and an ITEM of information is given. This algorithm deletes ITEM from the tree.

1.  [Find the locations of ITEM and its parent]

Call FINDS (INFO, RIGHT, ROOT, ITEM, LOC, and PAR).

2.  [ITEM in tree?]

if LOC=NULL, then write : ITEM not in tree, and Exit.

3.  [Delete node containing ITEM.]

if RIGHT[LOC] != NULL and LEFT[LOC] !=NULL then:

 Call CASEB(INFO,LEFT,RIGHT,ROOT,LOC,PAR).

Else:

 Call CASEA (INFO,LEFT,RIGHT,ROOT,LOC,PAR).

[End of if structure.]

4.  [Return deleted node to AVAIL list.]

Set LEFT[LOC]:=AVAIL and AVAIL:=LOC.

5.  Exit.

CASEB(INFO,LEFT,RIGHT,ROOT,LOC,PAR)

Computer Engineering, Engineering

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

Have any Question?


Related Questions in Computer Engineering

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Stock portfolio gui projectgoalyou are to write a gui

Stock Portfolio GUI Project Goal You are to write a GUI program that will allow a user to buy, sell and view stocks in a stock portfolio. For example, you might track the profit or loss on the trades. You might allow for ...

Questiondiscusses the development and evolution of decision

Question: Discusses the development and evolution of Decision Support Systems and identifies several categories : Model Driven DSS Data Driven DSS Communications Driven DSS Document Driven DSS Knowledge Driven DSS Conduc ...

Explain that this threat represents a well-known and broad

Explain that this threat represents a well-known and broad category of electronic and human activities that breach the confidentiality of information.

Question suppose you need to manually sort a hand of cards

Question : Suppose you need to manually sort a hand of cards. What techniques, other than a bubble sort, would you implement? Describe one or more algorithms at a high level.

Explain the risk of having hacking tools installed on your

Explain the risk of having hacking tools installed on your computer and why you should contact local law enforcement agencies before installing those tools.

Question research microwave serices and report on what

Question : Research microwave serices and report on what kinds of applications can be supported, what equipment will be necessary, where the equipment will be located, and what services these companies that offers.

Remembering the pythagorean theorem - the square of the

Remembering the Pythagorean Theorem - The square of the hypotenuse is equal to the sum of the squares of the other two sides Your assignment is to design a Fortran 95 program with three solutions for the quadratic equati ...

What is the various security architectures which provides

What is the various security architectures. Which provides the best balance between simplicity and security? Justify your answer.

List and describe the threats posted to information

List and describe the threats posted to information security and common attacks associated with those attacks

  • 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