Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider inserting the following sequence of integers (in order from left to right) into an empty BST. No need to show the tree here (
Consider inserting the following sequence of integers (in order from left to right) into an empty BST. No need to show the tree here ( may draw it in your notebook to answer the following questions)
A, 25, 8, 9, 35, 15, 22, 29, 20, B
You pick integers for characters A and B without generating any duplicates in the list.
- Show your sequence after A and B are replaced by your choice of integers.
- Give a pre-order, post-order and in-order traversal of the BST. [4pts]
- What is the height of the resulting tree? [1pts]
- pick an internal node ( no root and no leaf) and give the the depth and height of the node you picked?[2pts]
- Evaluate the Balance factor for each node according to the definition in your textbook. [6pts]
- Is the BST balanced? Explain. [2pts]
- Describe the search algorithm for the node 35 in this BST. How many comparisons are done before finding node 35? [4pts]
- Describe the algorithm for removing a node from a BST, make sure to include all cases. Pick a node with two children and describe how the node is removed. [4pts]
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