1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
svetoff [14.1K]
2 years ago
15

Please add thenodes given below to construct the AVL tree show all the necessarysteps,

Computers and Technology
1 answer:
Paha777 [63]2 years ago
7 0

Answer:

30,33,37,18,23,34,15,38,40,17

To construct the AVL tree, follow these steps and diagrams are shown in the image:

• Add 30 to the tree as the root node. Then add 33 as the right child because of 33 is greater than 30 and AVL tree is a binary search tree.

• Then add 37 as the right child of 33. Here the balance factor of node 30 becomes 0-2 = -2, unbalanced.

Use RR rotation, make node 33 the root node, 30 as the left child of 33 and 37 as the right child of 33.

• Now add 18 as the left child of 30. And 23 as the right child of 18. Here the balance factor of 30 becomes 2-0 = 2. It’s unbalanced.

Use LR rotation, make 23 the parent of 18 and 30.  

• Now add 34 as the left child of 37 and 15 as the left child of 18. Add 38 as the right child of 37. And then add 40 as the right child of 38.

• Now adding 17 as the right child of 15 makes the tree unbalanced at 18.

Use LR rotation, make 17 as the parent of 15 and 18.

Explanation:

The balance factor of a node can be either 0,1 or -1. Else the tree is called unbalanced at the node.

If the inserted node is in the left subtree of the left subtree of the unbalance node, then perform LL rotation.

If the inserted node is in the right subtree of the right subtree of the unbalance node, then perform RR rotation.

If the inserted node is in the left subtree of the right subtree of the unbalance node, then perform RL rotation.

If the inserted node is in the right subtree of the left subtree of the unbalance node, then perform LR rotation.

You might be interested in
Explain drawing and painting package.​
Murljashka [212]
Enhances drawing experiences, adds more features and adds better quality

8 0
2 years ago
Please helpppppppppppppp
viktelen [127]

Answer:

its D

Explanation:

The social worker likes to work with other people, so he/she might not like working alone.

6 0
2 years ago
A file with a com extension is most likely to be a(n) ___ file.
olasank [31]
I think that the answer is: A executable
4 0
3 years ago
Read 2 more answers
If an ______ is caught dumping hazardous materials, that person can be prosecuted. Answer choices A) Employee B) Employer C) Bot
Citrus2011 [14]

Answer:

Both A and B

Explanation:

I think it is right

hope this helps :)

5 0
2 years ago
Enumerate five features of Microsoft excel 2016​
Trava [24]

Answer:

Smarter Autocorrect, Improved Functions of Excel Workbook, New Funnel charts, and Smarter insertion of pictures.

Explanation:

For 8 features of Microsoft excel 2016, check out this website:

https://www.educba.com/features-of-2016-excel-workbook/

Hope this helps!

7 0
1 year ago
Other questions:
  • Suppose you send data to the 11111111 11111111 11111111 11111111 ip address on an ipv4 network. to which device(s) are you trans
    15·1 answer
  • Universal Containers needs to add an additional recipient to a workflow email alert that isfired from the case object. What type
    6·1 answer
  • This LEGENDARY character made a much-celebrated comeback in 2017. What was the name of the villain he faced in this epic tale?
    7·2 answers
  • The lightbulb transfers electricity energy into light what is one type of energy that is also generated that is not a desired af
    14·1 answer
  • 3. Which one of the following statements is correct? _____ variables are those whose storage bindings are created when their dec
    12·1 answer
  • How many cells does the organism have?\
    5·2 answers
  • Help me with this, please. Are vacuum cleaners, Cd players, and telephones considered computers? Do they store any data or proce
    8·2 answers
  • Brainliest For Tascake Because People Texted Before Tascake Could<br><br> Hurry Tascake
    13·2 answers
  • Would you consider upgrading Maxine’s wardrobe a need or a want?
    11·1 answer
  • What is the difference between HTML and XML?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!