I want to maintain order of the elements being added in a list. So, I used a LinkedList in Java.
LinkedList
Now I want to be able to swap two elements in the linke
Take a look at ArrayList , this class will both maintain the insertion order and provide O(1) random access.