For homework finish up the exercise from class. Specifically you'll need to answer questions (3) and (5).
Your code goes in the list.rb
file and you can run that code with
ruby list.rb
Hint: The method you write for determining the length can/should
follow the same pattern we used for add_to_tail
and to_s
. That
pattern also follows the recusive patterns we discussed in class: You
do one thing if @next
is nil
and something else when it's not.