"61A (*) Collect the leaves of a binary tree in a list. A leaf is a node with no successors. Write a method leaves to collect them in a list."
(deftest p61a-leaves (is (= '(b d e) (leaves '[a [b nil nil] [c [d nil nil] [e nil nil]]]))))
A variation on the previous exercise. Solution.
No comments:
Post a Comment