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

ERP and ITSM are interconnected in supporting the effective operation of an organisation’s IT infrastructure and business processes. By aligning ERP and IT

ERP and ITSM are interconnected in supporting the effective operation of an organisation’s IT infrastructure and business processes. By aligning ERP and ITSM efforts, organisations can ensure the reliable performance, security, and usability of ERP systems, ultimately driving business efficiency and success. In this assessment, you need to select one

Primary Task Response: Within the Discussion Board area, write 400-600 words that respond to the following questions with your thoughts, ideas, and

Primary Task Response: Within the Discussion Board area, write 400-600 words that respond to the following questions with your thoughts, ideas, and comments. Be substantive and clear, and use examples to reinforce your ideas. Read the Tyrvainen et al. (2006) article (see the Figure 1 framework) and Grahlmann et al. (2012) article (see the Figure 2

As a final deliverable to the management team, create a Power Point presentation (Should 7-8 slides) that summarizes the solutions outlined in the Key

As a final deliverable to the management team, create a Power Point presentation (Should 7-8 slides) that summarizes the solutions outlined in the Key Assignment template. In addition, describe why the proposed solution is the correct method or mechanism to be implemented. Key Assignment template. Propose an appropriate network infrastructure that

When designing your ePortfolio, you will want to ensure the navigation is intuitive. The artifacts presented in each section of your ePortfolio should

When designing your ePortfolio, you will want to ensure the navigation is intuitive. The artifacts presented in each section of your ePortfolio should demonstrate your understanding of professional and ethical responsibility in relation to cyber security operations and leadership. For this assignment, review your coursework  and identify artifacts that can

Primary Task Response: Write 400–600 words that respond to the following questions with your thoughts, ideas, and comments.  Be substantive and clear, and

Primary Task Response: Write 400–600 words that respond to the following questions with your thoughts, ideas, and comments.  Be substantive and clear, and use examples to reinforce your ideas. Before you start this assignment, please read the story entitled Data Breach an All-Too-Often Occurrence. After reviewing the story, conduct research online into

Primary Task Response: Write 400–600 words that respond to the following questions with your thoughts, ideas, and comments. Be substantive and clear, and

Primary Task Response: Write 400–600 words that respond to the following questions with your thoughts, ideas, and comments. Be substantive and clear, and use examples to reinforce your ideas. Before you start this assignment, please read the story entitled The Importance of Knowing Your Own Security Posture.  After reviewing the story, conduct

Assignment Type: Essay (any type) Service: Writing Pages/Words: 5 pages / 1375 words (Double spacing) Education Level: College Language: English (US)  Your

Assignment Type: Essay (any type) Service: Writing Pages/Words: 5 pages / 1375 words (Double spacing) Education Level: College Language: English (US)  Your Deadline: Aug 26, 08:00 PM  Assignment Topic: How to Avoid Being a Victim of Cybercrime Subject: Internet Technology (IT) Sources: 10 sources required Citation Style: APA 7th edition