Inserting into a Binary Tree in Scheme
问题 I am wondering how to insert elements from a list into a binary search tree. I am wondering why the following code does not work as I expected. The output is '((4 1 5 13 6) () ()) My next problem is going to be sorting the elements in the list, but for now I just want to insert them. Is my output correct for the problem I stated? My code is as follows: ( define ( make-tree value left right ) ( list value left right )) ( define ( value tree ) ( car tree )) ( define ( left tree ) ( cadr tree ))