Question: In computer science, a binary tree is a tree data structure in which each node has at most two children, which are referred to as

In computer science, a binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child. (a) Consider the following set of data to be inserted sequentially into an empty binary search tree: 6, 4, 15, 11, 16, 5, 21, 14, 3, 18, 10 Draw the resulting binary search tree. (5 marks) (b) There are four possible cases when we want to delete a node in a binary search tree. List ALL of them. (4 marks) (c) Based on binary search tree created in question (a), draw a new tree after: i. 13 has been inserted in the tree. (2 marks) ii. 16 has been removed from the tree. (3 marks) iii. 15 has been removed from the tree. (3 marks) (d) Based on binary tree created in question (a), write the order of the nodes visited in preorder traversal and postorder traversal. (4 marks) (e) Draw the expression tree for the following arithmetic expression: (a + b) * 6ld g)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
