LinkedList in DSA || Java and DSA course || Blog 16
I n simple words, a collection which can contain many objects of the same type, like the ArrayList is a LinkedList. Arraylist uses dynamic array. Lets say we take an array size of 5. we gave input as 1,2,3,4,5. Now, if we gave it one more value, It creates a new arraylist of sizex2 = 5x2 = 10. it copies data from the first arraylist and then appends the new value. if something is removed between the arraylist, every value shifts one by one. Same is with the insert. From this, we can say that arraylist is better for storing values instead of manipulating it. So what is the difference between ArrayList and LinkedList? In this blog we will take a look into Singular LinkedList and code related to it. For a quick overview, contents are, What is LinkedList? Difference between arraylist and linkedlist Creating Node class Add Node at beginning Extend a node Delete first node Delete last node What is LinkedList? LinkedList is nothing but nodes connected to each other. A node is a point ...