Implement and test the following BST method: def preorder_r(self): """

computer science

Description

Implement and test the following BST method: def preorder_r(self): """ ------------------------------------------------------- Prints the contents of the tree in preorder order. (Recursive algorithm.) Use: bst.preorder_r() ------------------------------------------------------- Postconditions: prints: The contents of the tree are printed preorder. Each value is printed on its own line. ------------------------------------------------------- """ Add the method to your bst_linked.py file in your data_structures project. Test it from q3.py. Hint: the method is recursive and requires an auxiliary functions. Example: A BST that has the values [55, 34, 58, 98, 21, 15, 67, 12, 31] inserted into it will print out those values in preorder as: 55 34 21 15 12 31 58 98 67


Related Questions in computer science category