The circular list code is incomplete program with lots of feature missing, it's only one specific section that I require help with but I thought it would better to show the entirety of it to help you understand better.
The section surrounded by -------------------------- is where I'm stuck, basically the print() method should start at the first element and go through the circular list printing each element until it returns to the first element. The program then rotates the list and prints each element again.
I feel that it maybe the "do...while" loop is causing the program since when I changed the "while" expression to "(c = while)", obviously wrong as it never ended, it successfully ran through the program and printed each element but when it's "(c != while)" it fails.
If anyone can offer any assistance as to what I've done wrong then it would be greatly appreciated, I've racked my brains for long time now! (I suck)
You have threecs there:
line 51
line 55
line 59
Your loop will never terminate because every c is always == first (so no matter which of the three the compiler chooses to use you've got an infinite loop).
Make sure to use just onec.
Also, watch how many times you change first. You want to bump it just once (if I understand you right).
Last problem I promise! I've succesfully got the singleRotateList() to work and output but after that's executed I want it execute the randomRotateList() and output accordingly.
The problem is the main() method I have calling it two different rotate() methods but it keeps referring to the first rotate(), ideally I want it to call to the first for the singleRotateList() and the second rotate() for randomRotateList().
I'm not to hot on abstract and overridable methods so if anyone can give me tips as to how I can achieve this it would be much appreciated, again!
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.