Exercise 9


In a new on-line game called "City of Assassins", we're going to insert characters (assassins) and give them missions. Instead of going after the usual kind of victim, we're going to send each assassin after another assassin. In fact, we will create N assassins and ask Assassin 0 to terminate Assassin 1. In turn, Assassin i will be asked to terminate Assassin i+1. Finally, Assassin N-1 will be asked to go after Assassin 0.

As makers of the game, we will place all the assassins in a circular linked-list that you will implement. The code is very similar to that of a linked list, with one exception: the last element points to the first element.

Thus, you will create a class called CircularList more or less like the linked-list we've seen in class. For the purpose of the game, you will implement one more method: fire():

To get started:

Submission:

What else is due: