Hello
This is my first post here since it is the first time i really needed help with my code.
My problem is that I have to write code using an iterator that will sort entries from integers 1-9. The sorting must be done exactly when the program gets the entry. the entities are added automatically in the link list and this has to be done for all next entries. it has to be done in descending order of 1-9.
this is what i have so far
public class PriorityFlightQueue2 { private LinkedList<Flight> flights; private Flight x; public PriorityFlightQueue2() { flights=new LinkedList<Flight>(); } public void joinQueue(String flightID,int priority) { x=new Flight(flightID,priority); flights.add(x); Iterator<Flight> it=flights.iterator(); while(it.hasNext()) { } }
Thanks in advance,
Palaboui