The wasBinarySearchTreeMaximum
function takes as arguments:
BST
) as a flattened list as per binary_trees.root
)and returns the maximal value in the binary search tree.
/////////////////////////////////////////////////////////////////////////// // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // /////////////////////////////////////////////////////////////////////////// string wasBinarySearchTreeMaximum(list BST, string root) { string node = wasBinaryTreeRight(BST, root); if(node == "") return root; return wasBinarySearchTreeMaximum(BST, node); }