title: Scheme Tree Depth
body: <p>I'm trying to write a function that takes a node and returns the depth of the tree rooted at this node. I have the following code so far:</p>
  
  <pre><code>(define (make-tree value left right)
    (list value left right))
  
  (define (value T) (car T))
  (define (right T) (caddr T))
  (define (left T) (cadr T))
  
  (define (insert x T)
    (cond ((null? T) (make-tree x '() '()))
          ((eq? x (value T)) T)
          ((&lt; x (value T)) (make-tree (value T)
                                      (insert x (left T))
                                      (right T)))
          ((&gt; x (value T)) (make-tree (value T)
                                      (left T)
                                      (insert x (right T))))))
  </code></pre>
  
  <p>I'm not exactly sure where to proceed from here. Any help would be appreciated.</p>