Question: please answer part a and b a) Create a binary search trees (BST) using the array [12,7,6,1 12,13,5,6,2,6,20,29,11,9,17,15]. If a value is equal to the
![(BST) using the array [12,7,6,1 12,13,5,6,2,6,20,29,11,9,17,15]. If a value is equal to](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3e99167e51_07366f3e9910b1a2.jpg)
a) Create a binary search trees (BST) using the array [12,7,6,1 12,13,5,6,2,6,20,29,11,9,17,15]. If a value is equal to the node, it goes to the right child. When you write your answer, use multiple lines to represent the structure. The number of lines is equal to the height of the tree. down "null" if there is no node in that space. For example, the tr picture should be write down like: 8 3,10 1,6, null, 14; null, null, 4,7 , null, null, 13 , null: 1,6 , null, 14; null, null, 4,7, null, null, 13 , null; b) How to remove a node from a BST? Explain in these 3 scenarios: the node is a leaf node, the node has only one child, and the node has two children
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
