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