Question: hey I need help with this question it is in python IMPORTANT: For this exercise, you will be defining a function which USES the BinarySearchTree
hey I need help with this question it is in python

IMPORTANT: For this exercise, you will be defining a function which USES the BinarySearchTree ADT. A BinarySearchtree implementation is provided to you as part of this exercise - you should not define your own BinarySearchtree class. Instead, your code can make use of any of the BinarySearchTree ADT methods: BinarySearchTree(), get_left(), get_right(), set_left(), set_right(), get_data(), set_data(), and search(). Define a function called create_bst_from_sorted(values) which takes a list of sorted values as a parameter. The function should create a balanced binary search tree. A tree is balanced if, for every node, its left and right sub-trees vary in height by at most, one. Note: You can assume that the parameter list is not empty. Do not use the insert() method in the BinarySearchtree class. Use recursion to solve this problem. For example: Test Result 3 tree = create_bst_from_sorted([1, 3, 5, 7, 9, 11, 13]) 7 print_tree(tree, 0) (L) (L) (R) 1 5 11 (L) (R) 9 13 tree = create_bst_from_sorted([1,2,3,4,5,6]) print_tree(tree, 0) N 4 (L) (L) (R) (R) (L) 1 3 6 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
