I am trying to write the algorithm for inorder traversal for a binary tree using RACKET/DR. RACKET
(define (print-records node number)
(cond
[(not (empty? node-left))(print-records (node-left node) number )]
*Do This before moving to next IF clause*
[(not (empty? node-right))(print-records(node-right node) number)]
))
I am trying to follow the following algorithm
InOrder(node)
if node is null return
InOrder(node.left)
Print(node)
InOrder(node.Right)
My problem is that through COND I can execute one expression and it will skip the rest. I tried to add two expressions under one it did not work either e.g ((a)(b)). I also tried to make a helper procedure but that did not work either.