Recitation 9 Exercises
Goals
The goals of this week's recitation assignments are to learn about Circular Linked Lists and looping over them.
Exercise
- Last week, you wrote a function to sum up the values in a linked list. This week, write a function that will sum up all the values in a circular linked list. Assume you have a Node class with two instance variables: int data and Node next. A parameter for this function will be a Node head which will represent the head of the Linked List. Remember: In a circular linked list, the last Node in the list points back to the first Node in the list.