implementing min max functions on bst