So, i am trying to find the least value of a binary search tree in racket and i keep getting this error:
cadr: contract violation expected: (cons/c any/c pair?) given: 'null
My code is the following:
(define minimum (λ (tree) (if (null? tree) null (if (null? (cadr tree)) (car tree) (minimum (cadr tree)))))
Each node has the structure (value, left, right).