0% found this document useful (0 votes)
140 views3 pages

Binary Search Tree

The document outlines the process of creating a binary search tree with the initial values 98, 2, 48, 12, 56, 32, 4, 67, 23, 87, 23, 55, and 46. It details the insertion of additional nodes 21, 39, 45, 54, and 63, as well as the deletion of nodes 23, 56, 2, and 45. The final structure of the tree is presented after these operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
140 views3 pages

Binary Search Tree

The document outlines the process of creating a binary search tree with the initial values 98, 2, 48, 12, 56, 32, 4, 67, 23, 87, 23, 55, and 46. It details the insertion of additional nodes 21, 39, 45, 54, and 63, as well as the deletion of nodes 23, 56, 2, and 45. The final structure of the tree is presented after these operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Question:

Create a binary search tree with the input given below: 98, 2, 48, 12, 56,
32, 4, 67, 23, 87, 23, 55, 46

(a) Insert 21, 39, 45, 54, and 63 into the tree

(b) Delete values 23, 56, 2, and 45 from the tree

SOLUTION:

The tree formed after inserting the node 98,2,48,12,56,32,4,67,23,87,20,55,46


(a)The tree after inserting the nodes 21,39,45,54, and 63 is shown below :
(b)The resultant tree after deleting the node 23,56,2,45 is :

You might also like