Computer Science, asked by deepikashine822, 3 months ago

Build an AVL tree with the following values:

{15, 20, 24, 10, 13, 7, 30, 36, 25, 42, 29}​

Answers

Answered by steffiaspinno
0

an AVL tree with these values looks like this:

Explanation:

  • There is a root node in every tree (at the top)
  • There are zero, one, or two child nodes in the root node.
  • There are zero, one, or two child nodes in each child node.
  • There are up to two children per node.
  • The left descendants of each node are smaller than the present node, which is smaller than the right descendants.

  • A further guarantee of AVL trees is that the depth difference between right and left sub-trees cannot exceed one. The balancing factor is the name given to this disparity.

\left[\begin{array}{ccccc}\\&&13&&\\\\\\&| && | &\\&10&&30&\\\\\\|&&|&&|\\7&&15&&36\\&&|&&\\&&|&&\\&&&|&\\&&&25&\\\end{array}\right]

 

Similar questions