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]
3 years ago
15

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

Computers and Technology
1 answer:
Paha777 [63]3 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
Client/server awareness. Visit three local stores in your neighborhood or mall and notice the information technology in the stor
Kaylis [27]

local stores in neighborhood do not have computerized cash registers but they may have cameras if they are in a bad neighborhood. inventory is controlled by checking the shelves.


the Qs about computers, servers and clients are for national chain stores. they use clients at each store which are connected to the central servers at HQ. employees need special training as the system is complicated. the whole system is maintained by their IT department.


7 0
3 years ago
Read 2 more answers
The automotive system that connects the engine and the transmission to the wheels is called the
insens350 [35]
I believe the driveshaft 

8 0
3 years ago
Write a program that asks the user for a word. Next, open up the movie reviews.txt file and examine every review one at a time.
Pie

Answer:

Wah?

Explanation:

6 0
3 years ago
Timing can be a major factor in the success of a business incorporation and emerging technology. Describe one potential problem
Serga [27]
The price could go up, it might not work then later down the road
5 0
3 years ago
Read 2 more answers
चार फरक छुट्याउनुहोस् ।) 3. Write down any four provisions of cyber ethic साइबर नैतिकताका कुनै चार प्रावधानहरु लेख्नुहोस् ।​
Kruka [31]

Answer:

Five provisions of cyber ethics are:

Your computer or system should not be used to harm others. Your cyber knowledge should not be used to steal other people's resources. One should not use or copy softwares for which you have not paid. ... Never use other people's resources without their consent.

7 0
3 years ago
Other questions:
  • JavaBeans are?A special Java classfileServletsAppletsA Special form of JSPNone of Given
    8·1 answer
  • Briley has all the hardware she needs to construct a fully functional personal computer. She connects the various components and
    7·1 answer
  • Which two actions allow the System Administrator to limit Chatter access during roll-out to a subset of Salesforce users?
    9·1 answer
  • When creating a chart or graph, which should be completed first?
    9·2 answers
  • write a c++ program that writes weather data from a file wx_data.txt to a file wx_summary for everyday of the year. also add min
    15·1 answer
  • You are a database administrator. Chantelle comes to you asking for help on how to access all the data in one row of the databas
    11·1 answer
  • Though most of the content on this social network is uploaded by amateurs, many companies offer streaming video content related
    10·1 answer
  • Because all the IEEE WLAN features are isolated in the PHY and ____________ layers, practically any LAN application will run on
    11·1 answer
  • The function below takes two arguments: a string (name) and an integer (position). Complete the function so that it prints out t
    7·1 answer
  • Choose the best collection for each situation.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!