function, write a function that computes factorials. (Recall that n!,
the factorial of n, is n times the factorial of n-1.)
-Warning: it takes a long time for my browser to compute factorials larger than 4!
+ Warning: it takes a long time for my browser to compute factorials larger than 4!
3. (Easy) Write a function `equal_length` that returns true just in case
two lists have the same length. That is,
- equal_length mylist (make_list junk (make_list junk (make_list junk empty)))
- ~~> true
+ equal_length mylist (make_list junk (make_list junk (make_list junk empty))) ~~> true
- equal_length mylist (make_list junk (make_list junk empty))) ~~> false
+ equal_length mylist (make_list junk (make_list junk empty))) ~~> false
4. (Still easy) Now write the same function, but don't use the length
be your base case for your recursive functions that operate on these
trees.
-1. Write a function that sums the number of leaves in a tree.
+<OL start=6>
+<LI>Write a function that sums the number of leaves in a tree.
Expected behavior:
sum-leaves tc ~~> 6
-2. Write a function that counts the number of leaves.
+<LI>Write a function that counts the number of leaves.
+
+</OL>