Question: a ) ( 3 marks ) Successively insert the values 5 0 , 8 0 , 3 0 , 6 0 , 7 0 and
a marks Successively insert the values and into an initially emply binary search tree. Show the resultant tree after each insertion.b marks Delete from the final tree in part a and show the two possible resultant trees.c marks The method to insert an item into a binary search tree is given below. Complete the code where indicated to permit duplicate insertions of an item.private Node AddI item, Node nodeif node nullreturn new Node item ;elseif item CompareTo nodeItemnode Left Add item node.Left ;return node;elseif item CompareTo nodeItemnodeRight Add item node.Right ;return node;elsed marks Using your algorithm in part c successively insert the values and into an initially empty binary search tree. Show the resultant tree after each insertion.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
