How to get order of collection when collection was first created
Hi
I have changed the sort order of a linked list by method of sort using comparator.Now i want to get back the sort order when the list first created.How i cant get that.The programe is as below
import java.util.*;
public class AlgorithmDemo{
public static void main(String args[]){
LinkedList <Integer> ll=new LinkedList <Integer> ();
ll.add(new Integer(-8));
ll.add(new Integer(20));
ll.add(new Integer(-20));
ll.add(new Integer(8));
System.out.println("Original order....");
System.out.println(ll);
System.out.println("Order after sorting....");
Collections.sort(ll);
System.out.println(ll);
System.out.println("Reverse sorting order....");
Comparator cm=Collections.reverseOrder();
Collections.sort(ll,cm);
System.out.println(ll);
System.out.println("After shufling....");
Collections.shuffle(ll);
System.out.println(ll);
}
}

