Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

LinkedList+in+Java

LinkedList is a part of the Java Collection Framework that implements the List Interface and is dynamic like ArrayList, allowing for duplicate elements and maintaining insertion order. The key difference is that LinkedList uses a doubly-linked list structure, providing constant time for adding and removing elements at the ends. Operations include adding and removing elements from both the beginning and end of the list.

Uploaded by

abhimanyu thakur
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

LinkedList+in+Java

LinkedList is a part of the Java Collection Framework that implements the List Interface and is dynamic like ArrayList, allowing for duplicate elements and maintaining insertion order. The key difference is that LinkedList uses a doubly-linked list structure, providing constant time for adding and removing elements at the ends. Operations include adding and removing elements from both the beginning and end of the list.

Uploaded by

abhimanyu thakur
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Java

Collection
LinkedList
Java Collection Framework:
LinkedList
• LinkedList is a part of collection framework which
implements the List Interface of Collection.
• LinkedList is also dynamic like ArrayList in Java.
• Like ArrayList, LinkedList also can contain the
duplicate elements and also maintain the
insertion order.
Java Collection Framework:
LinkedList
• The only difference in LinkedList and ArrayList is,
LinkedList stores elements in a doubly-linked list data
structure while ArrayList stores elements in a backing
array.
• LinkedList provide constant time for adding and
removing elements at the end of the list
Operations in LinkedList
• void addFirst(Object element) : It inserts the element at
the beginning of the list.
•void addLast(Object element) : It appends the element at
the end of the list.
•void removeFirst(Object element) : It delete the element
at the beginning of the list.
•void removeLast(Object element) : It delete the element
at the end of the list.

You might also like