Problem with list in Lisp
问题 I am trying to write a simple procedure in Lisp to insert an element into binary search tree. I represented the tree as a list: the first element in the tree is the root the second element is the left sub-tree the third element is the right sub-tree This is my code: (define Insert (lambda (x T) (if (null? T) (list x '() '()) (if (> x (car T)) (list (car T) (cadr T) (Insert x (list (caddr T)))) (list (car T) (Insert x (cadr T)) (list (caddr T))))))) When I call the procedure like this: (Insert