Question
1) Give one example of GOOD (i.e., nearly balanced) BST and one example of BAD BST. For example, {1, 2, 3, 4, 5, 6, 7}
1) Give one example of GOOD (i.e., nearly balanced) BST and one example of BAD BST. For example, {1, 2, 3, 4, 5, 6, 7} would be an example of a bad BST, while {4, 2, 6, 1, 3, 5, 7} would be a good BST. (2) Consider a random sequence of 12 positive integer numbers in the interval 1 .. 99.
Your sequence is: _________________________ Using the chosen sequence: (i) build a BST by inserting the numbers, one by one, in an initial empty tree and show the final resulted tree and (ii) list the tree nodes as a result of traversing the tree in inorder, preorder and postorder.
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