Repeatedly delete the root node of this Binary Search Tree(BST) until the tree is empty and display intermediate trees each time after deletion
$10-30 CAD
Completed
Posted about 4 years ago
$10-30 CAD
Paid on delivery
We have seven BST nodes whose keys are
{0, 1, 2, 3, 4, 5, 6}
[login to view URL] a Driver class [login to view URL], which builds BST T2 containing these seven nodes where the height of the tree is minimal. The program displays intermediate trees (i.e., each time
after insertion, the resulting BST is printed out).
2. Write a Driver class [login to view URL], which takes T2 as its input, repeatedly deletes the root
note until the tree is empty. The program displays intermediate trees (i.e., each time after
insertion, the resulting BST is printed out).
I already finished [login to view URL] which displayed below. The tree is displayed level
by level from the root. At each level, a node is followed by an indicator of its parent node
Output for [login to view URL]:
level 0: 3(root)
level 1: 1(left of 3)
level 0: 3(root)
level 1: 1(left of 3) 5(right of 3)
level 0: 3(root)
level 1: 1(left of 3) 5(right of 3)
level 2: 0(left of 1)
level 0: 3(root)
level 1: 1(left of 3) 5(right of 3)
level 2: 0(left of 1) 2(right of 1)
level 0: 3(root)
level 1: 1(left of 3) 5(right of 3)
level 2: 0(left of 1) 2(right of 1) 4(left of 5)
level 0: 3(root)
level 1: 1(left of 3) 5(right of 3)
level 2: 0(left of 1) 2(right of 1) 4(left of 5) 6(right of 5)
I need [login to view URL] to be completed and need the BST display a new tree after each deletion of the root node.
Desired Output for [login to view URL]:
level 0: 3(root)
level 1: 1(left of 3) 5(right of 3)
level 2: 0(left of 1) 2(right of 1) 4(left of 5) 6(right of 5)
level 0: 4(root)
level 1: 1(left of 4) 5(right of 4)
level 2: 0(left of 1) 2(right of 1) 6(right of 5)
level 0: 2(root)
level 1: 1(left of 2) 5(right of 2)
level 2: 0(left of 1) 6(right of 5)
level 0: 1(root)
level 1: 0(left of 1) 5(right of 1)
level 2: 6(right of 5)
level 0: 5(root)
level 1: 0(left of 5) 6(right of 5)
level 0: 0(root)
level 1: 6(right of 0)
level 0: 6(root)
null
Tree is now empty
Hi I'm an expert. If you hire me, i won't let you down. I can provide you all these things with unlimited revisions till the satisfactorily completion of [login to view URL] you
$30 CAD in 7 days
4.5 (42 reviews)
5.0
5.0
5 freelancers are bidding on average $42 CAD for this job
Dear Sir/Madam!
My name is Somai Norbert-Attila, I am a new freelancer from Romania.
I learn computer science at university.
I have about 2 years of Java experience and I have learned about binary search threes, implemented them too.
I think, I would be able to help you with your project.
Contact me to talk about the details.
Best regards,
Norbert