java – IT Blog
IT Blog
Boris IT Expert

How to remove duplicates from the sorted Linked List in Java.

November 2, 2020

How to remove duplicates from the sorted Linked List in Java.

If you want to remove duplicates from the sorted linked list in Java, you should follow several steps. This solution works only if the linked list is sorted. The fundamental idea is to start the while loop until the next element is null. Compare the current element with the next one. If the values are […]

October 29, 2020

How to reverse a linked list in Java (Iterative)

There are two ways to reverse a linked list in Java. Iterative and recursive. I will explain the iterative method of implementation. We will go through the example and present in the details each step of the process. If you want to know how to create the link list follow this page. The main principle […]

October 23, 2020

How to add items to the Linked List in Java.

In this article, you will know how to add item to the linked list java. If you are using the LinkedList type taken from the Java collections, you have several options: Adding the element at the beginning of the Linked List 2. Adding the element at the end of the Linked List 3. Adding the […]

October 23, 2020

How to find the length (size) of Linked List in Java (Android Studio)

If you want to find the Linked List length on an example of Java, you may follow two ways.It depends on what way of implementation you used. Firstly, you implement the LinkedList with the help of Java collections. On the other way, you may implement Linked List by creating your model and constructor. For more […]

October 21, 2020

How to implement Linked List in Java. Example.

What is a Linked List? Before answer the question “How to implement Linked List in Java. Example.” we need to understand how it works. That is one of the basic types of data structures. The main principle here is connecting new elements to the end of the current element. It looks like a train. Where […]