Sorted! seems so simple now, i now re set the iterator and it runs back through the list until sorted.
Thanks for all the help Norm.
Type: Posts; User: wdh
Sorted! seems so simple now, i now re set the iterator and it runs back through the list until sorted.
Thanks for all the help Norm.
I had another look, ive found circular linked lists which points the last node to the first so it keeps running through, that would help me to keep running through the list but in my head i imagine...
Sorry, dont understand what you are saying . . .
Currently its the same as below. If the current date is before previous then sorted = false. It still only runs through the list once though, im not sure how to get it to run through until all...
Im still not sure how to get this to loop through again. I set the boolean sorted to false if the if statement comparing the dates is true. I also have to set the boolean sorted to true at some point...
Ive added a temporary assignment to hold the previous element, and them im setting that element at the current index. Ive updated my code at the top of this page, the output shows that its working...
Thank you, that makes it clearer. So im setting the previous index to the correct date, but them im setting the current index to the same as the previous.
in orderSort()
date - is the previous date in the list
dateCheck - is the current date in the list
so dateCheck should be the date the iterator is currently on and it checks to see if it is...
Sorry its a bit of a mess, i usually seperate them into seperate files. It compiles and runs in the same way as before though.
import java.text.ParseException;
import...
I realised i hadnt assigned anything to the boolean sorted so it would never break and print the assignmentList. Changed that now and the printed assignmentList is very wrong. I just have two of...
I think its going someway to sorting the list, i changed firstIndex = assignmentList.indexOf(iterator.previous());
to firstIndex = iterator.previousIndex(); and i now get some output using the new...
Ive found the infinite loop is while(iterator.hasNext())
Ive also put a println statement in before i check the dates and both dates are the same, both dates are always set to the first date in the...
When i run it in my tester, it goes through the rest of my methods but when it gets to this nothing happens. It still says the program is running so i put a println statement in the while loop and...
At the moment this code is doing nothing. I can explain what i am trying to do with it though
While there is another element in the list, i store the index of the previous element, as well as get...
Im trying to do a bubble sort style process to my linkedList. It is a LinkedList of assignments, each with a set date stored as a string. I want to order the linkeList by the the date in which they...