3
所以我想写一个代码,返回二叉搜索树中的最小值。我知道这是树的最左边的价值,并且明白我需要它递归地运行到左边,直到没有剩下任何东西。但是我的代码不工作,我不知道为什么。任何帮助,将不胜感激。BST-Smallest Scheme
(define (bst-smallest bs-tree)
(cond ((null? bs-tree)
(display "undefined"))
((< (bst-value bs-tree) (bst-value (bst-left bs-tree)))
(bst-value (bst-left bs-tree)))
(else
(bst-smallest (bst-left bs-tree)))
))
谢谢!这更有意义! – Anon