I have attached the file below!! Question 1 (25 pts):   Figure 1 An AVL tree  1: Redraw the tree after insert 43 in the AVL tree of Figure 1. The

I have attached the file below!!

Question 1 (25 pts):  

Figure 1 An AVL tree 

1: Redraw the tree after insert 43 in the AVL tree of Figure 1. The resulting tree must be an AVL tree.

2: What is the balance factor at the root node after the insertion? 

Question 2 (25 pts):  

Figure 2 A B-Tree of order 5 

Using the B-tree in Figure 2,

(a)     Redraw the tree after inserting 74.

(b)     Redraw the tree after inserting 33 to the tree in (a).

(c)     Redraw the tree after inserting 56 to the tree in (b).

Question 3 (25 pts):  

Figure 3 Another B-Tree of order 5 

Using the B-tree in Figure 3;

(a)     Redraw the tree after deleting 22.

(b)     Redraw the tree after deleting 16 from the tree in (a).

(c)     Redraw the tree after deleting 4 from the tree in (b).

Question 4 (25 pts):  

Rewrite function searchNode(copied below) in B-tree class(bTree.h) by using binary search to search the node. Write a C++ code to ask user to enter a positive integer list ending with -999, build a b-tree of order 5. Also, ask the user to enter a number to search and display if the number is found in the tree.

Submit the source code, and copy and paste the screenshot of the output here.

template <class recType, int bTreeOrder> 

void bTree<recType, bTreeOrder>::searchNode 

(bTreeNode<recType, bTreeOrder>* current, 

const recType& item, 

bool& found, int& location) 

found = false; 

int low = 0; 

int high = current->recCount – 1; 

while (low <= high) { 

                              int mid = (high – low) / 2; 

if (item == current->list[mid]) 

{               

found == true; 

location = mid; 

else if (item < current->list[mid]) 

high = mid – 1; 

else 

low = mid + 1; 

}               

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Suppose that a certain basketball superstar has a 73.1% free throw percentage (that is, they make 73.1% of the free throws they attempt). Assume free

Suppose that a certain basketball superstar has a 73.1% free throw percentage (that is, they make 73.1% of the free throws they attempt). Assume free throw shots are independent from each other.If the basketball player is about to shoot 8 free throws, what is the probability that they miss at least 1 free throw shot? Give your answer rounded to four

Select one of the topics below: Autonomic computing Grid computing Nanotechnology N-tier client/server architectures On-demand computing Service-oriented

Select one of the topics below: Autonomic computing Grid computing Nanotechnology N-tier client/server architectures On-demand computing Service-oriented architecture (SOA) Storage area networks (SANs) Virtualization Write a research paper on the real-world application of the chosen technology. Your paper should include the type of organization(s) that benefits most from this technology.

Rubric for Assignment-3 Logical Data ModelInstructions:Draw a logical data model (ERD) for the Picnics R US case [Refer to ‘Assignment#1’

Rubric for Assignment-3 Logical Data ModelInstructions:Draw a logical data model (ERD) for the Picnics R US case [Refer to ‘Assignment#1’ and‘Assiignment#2’ on Canvas under ‘Assignments’]Rubric: 30% – Identify the entities 15% – Add appropriate attributes for each entity 15% – Assign identifies for each entity 15% – Draw the relationships