If I am attempting to minimize the height of a Binary Search Tree, are these the correct steps?:
1) produce a sorted array from the tree
2) reconstruct the tree by adding the sorted elements into the tree inorder
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
After sorting the elements, you rebuild the tree by defining the middle element to be the root node, and then recursively build the left and right subtrees from the elements preceding and following the middle, respectively.