- Define A Recursive Function Called Get Concatenated Words Bst Which Takes A Binary Search Tree As A Parameter The Fun 1 (34.41 KiB) Viewed 14 times
Define a recursive function called get_concatenated_words (bst) which takes a binary search tree as a parameter. The fun
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Define a recursive function called get_concatenated_words (bst) which takes a binary search tree as a parameter. The fun
Define a recursive function called get_concatenated_words (bst) which takes a binary search tree as a parameter. The function returns a string object containing values in the in-order traversal of the parameter binary search tree. You can assume that the parameter binary search tree is not empty. 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 fields and methods. For example: Test Result print(get_concatenated_words (tree)) ABCDEFGHIKNPRUY = athote bst = BinarySearchTree('hot') bst.set_left(BinarySearchTree('at')) bst.set_right(BinarySearchTree('o')) print (get_concatenated_words (bst))