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
What new information, strategies, or techniques have you learned that will increase your technology skills? Explain why its impo
Minchanka [31]

Taking brakes every hour so your eyes don't start to strain.

6 0
3 years ago
give your opinion on if you would trust your accounts with an online bank. Explain why or why not. MANY people do not. MANY peop
blagie [28]
I would not because you never know there could be hackers and they could get your card account and spend your money. If they get your card number and you do turn up with less money there is really nothing you can do about it at that point. That's why I wouldn't trust my money to an online bank. 

                                                   Hope this helps.
                                          Sincerely, Hodctilana
5 0
3 years ago
Read 2 more answers
If you have machines doing jobs, fewer staff are needed, therefore costs are
elena55 [62]
If you have machines doing jobs, fewer staff is needed, therefore the costs are LESS.

Hope I helped!
4 0
3 years ago
Read 2 more answers
Please write a code for below:
Zanzabum

Answer:

int main()  

{  

   int x,y;  

   bool b1, b2;  

   cout<<"enter values of x : ";

   cin>>x;

   cout<<"enter values of y : ";

   cin>>y;

   b1 = y > x; // false  

     

   b2 = x > y; // true  

     

   cout << "b1 is = " << b1 << "\n";  

   cout << "b2 is = " << b2 << "\n";  

     

   if (b2)  

       cout<<endl << "Larger Number" << "\n";  

   else

       cout << "Smaller Number" << "\n";  

         

     

return 0;  

}

8 0
3 years ago
What symbol should you look for to determine who owns the intellectual property of a website? the logo the web address the domai
devlian [24]

Answer:

Answer:

the logo of the company or corporation

Explanation:

Usually, the symbol that determines who owns the intellectual property is the logo of the company or corporation. The logo of a website is technically the logo of the brand which has the rights to all of the information represented on the site and ultimately the intellectual property of the site itself. Since there are various board members that usually make up the company that owns the intellectual property, the logo is a way of representing all of these members as a single entity.

8 0
2 years ago
Read 2 more answers
Other questions:
  • While in an interactive nslookup session, you'd use the ______ keyword to change the DNS server you're using
    5·2 answers
  • Please help will mark brainiest
    8·1 answer
  • What does the do not disturb button do on the iphone?
    12·1 answer
  • What kind of video are you are able to watch by downloading it from the Internet?
    10·1 answer
  • A web client is sending a request for a webpage to a web server. from the perspective of the client, what is the correct order o
    14·1 answer
  • _______ data would be useful for creating a report containing last year's revenue, which won't be changing.      A. Integrated B
    12·1 answer
  • Monitors display images by using a grid made up of millions of tiny dots, called ________.
    13·1 answer
  • GIVING BRAINLIST TO WHOEVER ANSWERS
    9·1 answer
  • What is the output of this program? Assume the user enters 2, 5, and 10.
    6·1 answer
  • A 4"x6" photo is digitized using 10,000 pixels. An 11"x7" photo is digitized using 30,000 pixels. Which image will have the bett
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!