Explain how a node can be inserted into an avl tree, Computer Engineering

Assignment Help:

Explain how a node can be inserted into an AVL tree.

We can insert a node into an AVL tree through the insertion algorithm for binary search trees in which we compare the key of the latest node with that in the root and then insert the latest node into the left subtree or right subtree depending on whether it is less than or greater than that in the root. Insertion might or might not result in change in the height of the tree. Whereas inserting we must take care that the balance factor of any node not changes to values other than 0, 1 and -1. A tree becomes unbalanced if and only if

(i) The latest inserted node is a left descendant of a node that lastly had a balance of 1.

(ii) The latest inserted node is a right descendent of a node that lastly had a balance of -1.

 


Related Discussions:- Explain how a node can be inserted into an avl tree

Types of reasoning - first-order logic, Types of reasoning - First-order lo...

Types of reasoning - First-order logic: Atleast five types of reasoning can be acknowledged here. • Firstly, why and how do we will think for the killer usually left a silk

Programming, Write a procedure for each of the following: (i) To find the m...

Write a procedure for each of the following: (i) To find the maximum MAX of the values in the list. (ii) To find the average MEAN of the values in the list. (iii) To find the produ

Versions of small computer systems interface, Q. Versions of small computer...

Q. Versions of small computer systems interface? SCSI-1 calls for a cable with 8 data wires plus one for parity. SCSI-2 allows use of multiple cables to support 16- or

Cache simulater, Requirements You are required to program (in a high l...

Requirements You are required to program (in a high level language such as C, C++, Java) and implement a cache simulator which will have the following inputs and outputs:-

Describe the difference between cache and virtual memory, Question 1: (...

Question 1: (a) What do you meant by an expert system? (b) Describe benefits of the EDI. (c) Describe what you understand by: (i) File Infectors (ii) Boot Sect

Construct a shift register from S-R flip-flops, Construct a shift register ...

Construct a shift register from S-R flip-flops. Explain its working. Ans: S-R Flip-Flop Shift Register: Shift registers can be built through using SR flip-flops. Fig.(a)

What is the purpose of guard bits, What is the purpose of guard bits used i...

What is the purpose of guard bits used in floating point operations? The guard bits are the extra bits which are used to retain the in-between steps to enhance the accuracy in

Array processing, Array Processing We have seen that for performing vec...

Array Processing We have seen that for performing vector operations, the pipelining concept has been taken. There is another method for vector operations. If we have an array o

Design a mod-12 synchronous up counter, Design a mod-12 Synchronous up coun...

Design a mod-12 Synchronous up counter. Ans. Design of a mod 12 synchronous counter by using D-flipflops. I state table Present state                                   Next

What are different types of verilog simulators, What are Different types of...

What are Different types of Verilog Simulators? There are essentially two types of simulators available. -  Event Driven -  Cycle Based

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd