October 31, 2020
One of the common questions on the technical interview is to find the nth element from the last in the linked list in Java. To solve this problem, you should use the pointers’ technique. We should set two-pointers and set a needed distance between them. After that, we should move both of them until the […]
October 30, 2020
There is a straightforward way to find the middle element of the linked list java. Since it is one of the common questions on any technical interview, it is good to know the elegant solution. It will work just if you have implemented the linked list with the constructor and model class’s help. If you […]
October 29, 2020
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 28, 2020
In case you want to find an element in the Linked List in Java, there is an easy way to do so. That way of the implementation works if you have implemented the linked list with the constructor and the model class’s help. I have explained the details of implementing the linked list in this […]
October 24, 2020
Remove an item from the Linked List by using object of collections in Java, you may call several methods: Remove element by value 2. Remove first element in the Linked List 3. Remove last element in the Linked List Removing the element from Linked List in Java without collections. If you are using your implementation […]
October 23, 2020
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
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
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 […]