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
Which of the following is the largest unit of information?
Mila [183]
What are the choices?

5 0
3 years ago
Read 2 more answers
All spreadsheet formula should start with
inysia [295]
A formula in Excel will ALWAYS start with = then the function name like
=SUM(A1:A5)
5 0
3 years ago
In the code snippet below, pick which instructions will have pipeline bubbles between them due to hazards.
denpristay [2]

Answer:

b. lw $t4, 4($t0)

c. add $t3, $t5, $t4

Explanation:

Pipeline hazard prevents other instruction from execution while one instruction is already in process. There is pipeline bubbles through which there is break in the structural hazard which preclude data. It helps to stop fetching any new instruction during clock cycle.

7 0
2 years ago
Introduction or background of corporal punishment in schools
tensa zangetsu [6.8K]

Answer:

Corporal punishment is a discipline method in which a supervising adult, such as a teacher, deliberately inflicts pain upon a child in response to a child's unacceptable behavior or inappropriate language. The goals of this type of punishment are usually to halt the offense immediately, prevent it from happening again, and set an example for others.

3 0
2 years ago
The simple concept of personal computing, hatched by several Silicon Valley entrepreneurs and permeating almost all of modern so
rjkz [21]

Answer:

True

Explanation:

The advent of personal computing brought about by the implementation of several technologies including MOSFET, semiconductors, microchip and integrated circuits has revolutionized life in at a very high rate of change where traditional ways of doing things rapidly change and for the first time power was easily reachable by accessing a personal computer.

1. The computer personal computer brought about word processing, where there are very limited errors in individually printed documents and the time to produce a quality document was reduced

2. Email - With the advent of personal computers email, the information and communication time were lowered and it resulted in changes in commerce

3. Video conferencing - It was possible to have video conferencing with people and make decisions regarding direction can be made real time from very distant locations, which improved business reaction time

4. The mouse- The concept of having a graphic user interface improved computer interaction for people with limited programming skills.

7 0
3 years ago
Other questions:
  • Identify the false statement.
    8·1 answer
  • A network administrator notices that some newly installed Ethernet cabling is carrying corrupt and distorted data signals. The n
    8·1 answer
  • Which of the following is something you need to keep an eye out for
    7·2 answers
  • 15. Write a program in python to read three numbers in three variables and swap first two variables with the sums of
    8·1 answer
  • Suppose L is a LIST and p, q, and r are positions. As a function of n, the length of list L, determine how many times the functi
    8·1 answer
  • Peripeteia is also referred to as __________.
    5·2 answers
  • JUST NEED TO KNOW WHO ALL DOSE EDGINUITY
    12·2 answers
  • Please choose the correct answer please tell fast​
    15·1 answer
  • Any my hero academia fans out there don't report at all just what more friends to
    14·2 answers
  • A. In I/O interation between OS and devices, describe how hybrid mechanism works?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!