Question: Write a Scheme function: listleaves, defined so that (listleaves bt) lists the leaves in the binary tree bt, using the representation discussed in class and
Write a Scheme function: listleaves, defined so that (listleaves bt) lists the leaves in the binary tree bt, using the representation discussed in class and the text. For example, (listleaves '(a (b (c () ()) (d () (f () ()))) (e () ())))
returns, (c f e)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
