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

Assessment 4: Research Proposal ReportDue date: Week 12Group/individual: IndividualWord count/Time provided: 2000 wordsWeighting: 30%Assessment 4

Assessment 4: Research Proposal ReportDue date: Week 12Group/individual: IndividualWord count/Time provided: 2000 wordsWeighting: 30%Assessment 4 DetailThis assessment requires student to develop a two-page paper with IEEE format based on previousthree assessments. It is expected that student will use this idea for further develop their Capstoneresearch project (Applied Research Project) in

I’ve attached the instructions and PowerPoint template needed for the work. To complete this assignment, you will need the attached files and the Small

I’ve attached the instructions and PowerPoint template needed for the work. To complete this assignment, you will need the attached files and the Small Merchant Guide to Safe Payments documentation (click link to download) from the Payment Card Industry Data Security Standards (PCI DSS) organization. Please read the instructions carefully and ask questions if

Design a BN for a new school building. Attached are three preliminary school blueprints. Each room will only have an instructor computer except

Design a BN for a new school building. Attached are three preliminary school blueprints. Each room will only have an instructor computer except for four labeled computer labs with 30 computers each. Create LANs to group the classrooms (determine how many per LAN by distance and location in the building) for all the teacher’s computers in the lecture halls/rooms. Each

Case Study https://www.dropbox.com/ Case

Case Study Case Study scl/fi/i9s2br812hcrdv1rjp5lc/GGFRT-Case-Study1-2245.pdf?rlkey=hs55yycv4tkk1tlcdxppxvxrs&st=1dyojc6z&dl=0 IT Plan 1 scl/fi/xv8mt8xcm9pjzf0rrtfuk/Mosley-s-IT-Strategic-Plan-GGFRT.docx?rlkey=3il6s7divy98soadjb6iai2di&st=hhu5hkfu&dl=0 IT Plan 2

This assignment is to submit a 12-page report on Cisco’s Vision: A smart +connected world using the working template provided and additionally

This assignment is to submit a 12-page report on Cisco’s Vision: A smart +connected world using the working template provided and additionally answering: ·        Explain the challenges of innovating and implementing new technologies on a large scale in this case.   ·        Telepresence is an innovative technology that requires widespread

Describe which areas and departments should have standards, and what kind of standards they should have. Explain the importance of having different

Describe which areas and departments should have standards, and what kind of standards they should have. Explain the importance of having different standards throughout various departments. Describe relevant agencies and organizations that determine and monitor the standards. Note: Include abstract and use APA style and 2 scholarly references. Deliverable Length: 3-4 pages

Within the Discussion Board area, write 300-500 words that respond to the following questions with your thoughts, ideas, and comments. Be substantive and

Within the Discussion Board area, write 300-500 words that respond to the following questions with your thoughts, ideas, and comments. Be substantive and clear, and use examples to reinforce your ideas. Standardization can help promote quality patient care and reduce costs for hospitals. There are many areas containing different people, practices,