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
What are two options available for highlighting changes in the Highlight Changes dialog box?
lukranit [14]

Answer: D

Within a specific time period or by a specific user

Explanation:

4 0
2 years ago
Read 2 more answers
What to do if you click on a phishing link on iphone
gregori [183]

Answer:

Nothing, just exit out of it

Explanation:

5 0
2 years ago
Read 2 more answers
When you are almost done with your soup and want to get at the last little bit, how should you do this 2
pav-90 [236]

Answer:

<u>B. Tip the bowl slightly, then spoon up the last bit</u>

Explanation:

Generally speaking none of the other answers made much of sense.. "tip the bowl from side to side" doesn't help you at all, neither does "Keep spooning as much as you can, then stop eating". Neither of these will help you spoon up the last little bit, <u>the most logical answer is B. "Tip the bowl slightly, then spoon up the last bit"</u>. If this is not the correct answer then it'd be D, but I don't believe/feel that it's "poor etiquette" to "leave the last little bit".

7 0
2 years ago
A _________ is a series of commands and instructions that you group together as a single command to accomplish a task automatica
melamori03 [73]
A macro is a series of commands and instructions that you group together as a single command to accomplish a task automatically.
8 0
3 years ago
What is the most appropriate data type for each of these items?
Tom [10]
I may be wrong, BUT here is what i think



b) line graph


d) pie graph
7 0
2 years ago
Other questions:
  • When called upon to give an impromptu speech, it is a good idea to do all of the following, except:
    11·2 answers
  • Ryan has created a Word document to be used as a review quiz for students in a classroom setting. The document contains both que
    6·1 answer
  • What is secondary exchange ? - Apex
    14·1 answer
  • What is the difference between a software engineer and a system analyst?
    8·1 answer
  • The objective of an Enterprise Resource Planning (ERP) system is to create a customized software program that integrates the inf
    15·1 answer
  • Given two int variables , firstplacewinner and secondplacewinner, write some code that swaps their values . declare any addition
    11·1 answer
  • What is the missing line of code?
    7·1 answer
  • 4.12 LAB: Using math methods Given three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to
    10·1 answer
  • Your friend has a great idea for a new app, and she shows you a document that outlines what the app will do. This document is an
    6·1 answer
  • Explica el empleo de cuentas y contraseñas en archivos
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!