Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 5 In computer science, a binary tree is a data structure in which each node has at most two children, which are referred to
Question 5 In computer science, a binary tree is a data structure in which each node has at most two children, which are referred to as the left child and the right child. (a) Suppose the following items are inserted in the order given into an empty binary search tree. 16, 12, 7, 15, 8, 21, 9, 26, 4, 20, 32 1. Draw the resulting binary search tree. (6 marks) ii. List ALL the leaf nodes of the tree. (2 marks) ii. Give the preorder, inorder and postorder traversal of the tree. (6 marks) (b) Given the postfix expression below: a b + cd-refug i. Convert the expression to infix notation expression. (4 marks) ii. Create an expression tree for the expression (5 marks) iii. Write the prefix notation expression of the expression. (2 marks) [25 Mark]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started