Question: 2. a. While building a binary search tree (BST), if the numbers come in the following sequence: 8, 7, 9, 20, 11, 10, 12, 13,
2. a. While building a binary search tree (BST), if the numbers come in the following sequence: 8, 7, 9, 20, 11, 10, 12, 13, 5, 1; what will be the tree like after constructed? How many comparisons are made totally? b. Given the following binary tree, write the InOrder, PreOrder, PostOder traversals. c. Given a binary tree with 8 nodes, if its InOrder and Postorder traversal results are: InOrder PostOrder: 3 2147685 12345678 Reconstruct the tree according to the results; is this tree a binary search tree? The following specifications will be expected for each programming project in this class: 1. An empty project file must be created at the beginning, and then you will create/add new source files and header files. 2. Add comments at the beginning of the program, and add description for each function, loop, etc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
