How to remove duplicates from linked list

A LinkedList can store the data by use of the doubly Linked list. Each element is stored as a node. The LinkedList can have duplicate elements because of each value store as a node. But there may be a situation when we want to store only unique elements in LinkedList and want to remove duplicates … Read more

How to remove duplicates from ArrayList in java

An ArrayList can contain duplicate elements because each value stores in a unique index. But there may be a situation when we want only a unique element In ArrayList and want to remove duplicates from ArrayList java. There are a number of ways to remove duplicates from list in java. Let’s see how to remove … Read more

Difference between ArrayList and LinkedList

In java, ArrayList and LinkedList both are linear data structures in the Collection framework. Both data structures introduced due to the limitation of the array because the Array has a predefined and fixed size. In this post, we will see the difference between ArrayList and LinkedList. There are many similarities in both, but we will … Read more

Traverse a linked list java

LinkedList doesn’t support the random access, to find an element we have to traverses the LinkedList. Let’s see how we will traverse a linked list java. There are some methods that can be useful to iterate the LinkedList. We have different types of iterator for linked list in java. Here is the table content of … Read more

Java linked list methods

Java LinkedList class has a lot of methods to perform different types of operation. In this post, we will discuss all the Java linked list methods with an example. Let’s see the Java linked list methods. 1. How to add elements to a LinkedList? add(E e): This method adds a node in LinkedList. It appends … Read more

How to convert linked list to array in java

We have read, a lot of things about LinkedList in java. In this post, we will see how to convert a LinkedList to Array. We know Array works on based of index and LinkedList works based on doubly linked list structure. Let’s see How to convert linked list to array in java, there are some … Read more

Searching in linked list

In a recent post, we have seen how to add, remove, and retrieve the element from LinkedList in java. In this post, we will know how to search in linked list. We have some methods that help us to search an element in linked list. Let’s see how to perform Searching in linked list. As we … Read more

How to perform linked list sorting

In java, we have how to perform some basic operations on Java LinkedList. But there may be a situation when we want to perform some complex on LinkedList like how to sort a linked list. In this post, we will see the sorting of LinkedList objects that totally depends on Comparable or Comparator. Here is … Read more

How to get the element from LinkedList

We have seen, creation of Java LinkedList, LinkedList insertion, and How to perform deletion in linked list. In this post, we will see how to retrieve elements from LinkedList or get the element from LinkedList, and see different methods in java LinkedList get the node. There are some methods that retrieve and remove the element … Read more

How to perform deletion in linked list

In a recent post, We have seen how to perform LinkedList insertion. In this post, we will see, How to delete a node from linked list? Unlike ArrayList, LinkedList doesn’t use continuous memory allocation to store the elements. Each element link with other so let’s see how can delete node at given position in a … Read more