KillerDesigner
12/2/2013 - 9:25 PM

exercise.md

Exercises/Lab for Linked Lists

1.) Write a function called last that finds the last node in the list.

2.) Write a function called count that gets the length of linked list. Don't use the #count method.

3.) Write a function called average that sums a linked list of numbers and divides it by the length.

4.) Write a function to reverse a linked list.

5.) Write a function called palindrome to take a linked list of vals and returns a list that it reads the same way forward and backwards, i.e. palindrome (1,2,3) => (1,2,3,3,2,1).

6.) Write a function to check if a linked list is a palindrome.