what are the conditions for a circular linked list if there is only one data left in it?
current.getNext() == head && ???
Printable View
what are the conditions for a circular linked list if there is only one data left in it?
current.getNext() == head && ???
Excuse me?
// Json
It'd point to itself (analogy: dog chasing it's tail). However, if you have a circularly linked list, it'd have no head, or everything could be the head (depending on how you're looking at it).
May I ask why would you want a circularly linked list?
thanks helloworld922
this circularly linked list is just an assignment my lecturer gave me. im suppose to create a linked list classes that input 6 data and remove every 3rd data continuously in the linked list until 1 remain.
e.g. 1 2 3 4 5 6 remove 3
1 2 4 5 6 remove 6
1 2 4 5 remove 4
1 2 5 remove 2
1 5 remove 5
1
i figured out the solutions already. thanks anyway (=
Hello student123xyz. Welcome to the Java Programming Forums :D
You did post in the correct forum, the tips & tutorials forum is more for tutorial code snippets. I would of moved the thread to here anyway :P
I'm glad you have your solution. Please in future mark your threads as solved. I have done it for you this time..