Recursion Experiment
Given a Cons class in Java, make a List class
- Students had trouble interpreting the question.
- Students had trouble reconciling functional style from mutation
Given the List class, write non-destructive append
- No one used recursion.
- The iterative solution involved while loops.
- 2 students destructively appended the lists.
- 3 students got tripped up when their use of while reversed the lists.
- 1 student used a Vector to get around the list reversal caused by while.