A binary search tree is a binary tree with a special property. For all nodes, x, all of the values in the left sub-tree
Posted: Fri May 20, 2022 6:30 pm
A binary search tree is a binary tree with a special property. For all nodes, x, all of the values in the left sub-tree of x are less than x, and all of the values in the right sub-tree of x are greater than x. The following diagram shows a binary search tree with this property: 34 58 / / / 22 43 9 69 Define a function called create_bst() which builds and returns the above binary search tree. Note: 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 fields and methods (e.g. insert()). For example: Test Result 19 9 bst = create_bst() 34 print_tree (bst, 0) (L) (L) (R) (R) (L) (R) 22 58 43 69