Java-Linked List with example
The java.util.LinkedList class operations perform we can expect for a doubly-linked list. Operations that index into the list will traverse the list from the beginning or the end, whichever is closer to the specified index. The important points about Java LinkedList are: It is an ordered set comprising a variable number of data items. No need to specify; grow and shrink during execution. Element position is assigned during run time. Stored randomly Insertion and deletion of element will be Easier, fast and efficient. Compared to array ,Linked list required more memory Hierarchy of LinkedList class Method & Description boolean add(E e): It is used to append the specified element to the end of a list. void add(int index, E element): It is used to insert the specified element at the specified position index in a list. boolean addAll(Collection<? extends E> c): It is used to append all of the elements in the specified collection to the end