Example In this example we are converting a LinkedList to ArrayList. We have a LinkedList of Strings in which we are storing names of 5… [Read More]
Java – Get first and last elements from LinkedList example
In this tutorial we will see an example on how to get first and last element from LinkedList. Example Here we have a LinkedList of… [Read More]
Java – Get sub List from LinkedList example
Example In this example, we are getting a sublist of LinkedList using subList(int startIndex, int endIndex) method of LinkedList class. It returns a List between… [Read More]
Java – Add element at specific index in LinkedList example
In this tutorial we will learn how to add a new element at specific index in LinkedList. We will be using add(int index, Element E)… [Read More]
Java – LinkedList Iterator example
In the last post we learnt how to traverse a LinkedList using ListIterator. Here we will learn how to iterate a LinkedList using Iterator. Example… [Read More]
Java – LinkedList ListIterator example
In this example we will see how to iterate a LinkedList using ListIterator. Using Listterator we can iterate the list in both the directions(forward and… [Read More]
Java – Remove all elements from LinkedList example
In this example we will see how to remove all the elements from LinkedList. We will be using clear() method of LinkedList class to do… [Read More]
Java – Remove first and last element from LinkedList example
In this tutorial we will learn how to remove First and Last elements from LinkedList. In the few last posts we shared following tutorials: 1)… [Read More]
Java – Remove specific elements from LinkedList example
In the last post we shared a tutorial on how to remove a element from specific index in LinkedList. Here we will learn how to… [Read More]
Java – Remove element from a specific index in LinkedList example
In this example, we are gonna see how to remove an element from LinkedList. Example We will be using remove(int index) method of LinkedList class… [Read More]
Java – Replace an element in a LinkedList with example
In this article, we will learn how to replace an element in linked list using set() method. This method is especially useful when we need… [Read More]
Java – Search an element in LinkedList with example
In this tutorial, we will learn how to search elements in LinkedList in Java. We will be writing a java program that searches a given… [Read More]
Difference between ArrayList and LinkedList in Java
In this guide, you will learn difference between ArrayList and LinkedList in Java. ArrayList and LinkedList both implements List interface and their methods and results… [Read More]
How to loop LinkedList in Java
In the last tutorial we discussed LinkedList and it’s methods with example. Here we will see how to loop/iterate a LinkedList. There are four ways in… [Read More]
LinkedList in Java with Example
Similar to arrays in Java, LinkedList is a linear data structure. However LinkedList elements are not stored in contiguous locations like arrays, they are linked… [Read More]