Here's what I have for the depth program, but how to do it without max function (only use define, lambda,quote (‘), car, cdr, cons, cond, eq?, and equal?)?
(define depth
(lambda (expr)
(cond ((null? expr) 0)
((list? (car expr))
(max (+ 1 (depth (car expr))) (depth (cdr expr))))
((null? (cdr expr))0) (max (depth (cdr expr))))))
input: ((id = id + id)(if bool then (if bool then ( id = id + id ))(id = const / const)(id = id + id))(while bool (id = id - const)(id = id - id)))
Should output: maximumdepth: 2