Posts

Showing posts with the label linkedlist

Linked List Implementation : In Simple Terms

Image
Java Starter Kit #1 Overview In Java POV, the collection framework gives us a wide range of data structures to choose from. Among them, one of the legacies yet widely used data structure is Linked List . The major Pros of Linked List come into play when the data structures need to store a huge amount of values or when the length is not definite. This is the time when this implementation of collection shines. The insertion and deletion of elements from LL are faster than other data structures.  Unlike array which again is a popular implementation of List interface in Java, LL doesn't store data in a continuous manner. Some other pros include: - Zero Memory Wastage: when an element is inserted or deleted, the allocation of memory is dynamic. When removed the previously-stored node reference is removed as hence GC clears it. And when inserted it allocates a new node when it is inserted and doesn't pre-occupy any space in the heap at the initialization of LL. Linked Lis