A circular linked list in Java
I was helping a friend of mine with her work today, and we came across with a requirement that there are few players in the room we need to know whose turn is it after this. Yes, we can definitely use a LinkedList or an ArrayList, but its not so convenient as we have to check whether this player is at the last position of the list. If so,we will need to start from the beginning of the list again. And its also quite cumbersome to retrieve the next player info after this. Therefore, I wrote a simple yet functional Circular Linked List. You can download the source code and the compiled class here . I will port this over to Scala whenever I have the time to do so.
Happy coding
Sorry, the comment form is closed at this time.
Sorry, the comment form is closed at this time.