I am confused over the searching complexity of LinkedList in java. I have read that time complexity to search an element from a LinkedList is O(n). say for example,
LinkedList<String> link=new LinkedList<String>();
link.add("A");
link.add("B");
link.add("C");
System.out.println(link.get(1));
Now, from here by get(index) method we can say that to search an element It should take O(1) times. But I have read that it will take O(n). Can anybody help me out to get clear concept?