Thursday, 9 March 2017

JAVA : COLLECTION : LINKED LIST

JAVA : COLLECTION : LINKED LIST


Underline data structure for Linked List is -> Doubly linked list.

If we search for 10000 th element -> it takes 10000 secs, bez it always searches from 1st, because 10000 element address is with 9999, 9999 element address is with 9998 .......... 2nd element address is with 1st element.


  • Internally its Doubly linked list
  • Insertion order is preserved
  • Duplicates are allowed
  • Hetrogeneous elements are allowed (In collection exept TreeSet and TreeMap all collection it is allwoed)
  • Null is allowed
  • Not implement RandomAccess, but it implements Serializable and Clonable interfaces.



Linked List is mainly used to develop Stack and Queue

If you see in Stack and Queue since it is LIFO or FIFO not like in between element will be searched, and pop or add will be done sequentially, these objects are implemented using LinkedList.



https://www.youtube.com/watch?v=ZqDT9xg4TGE&t=1100s

No comments:

Post a Comment