Yes, LinkedList is a doubly linked list, as the Javadoc mentions :

Doubly-linked list implementation of the List and Deque interfaces. Implements all optional list operations, and permits all elements (including null).

All of the operations perform as could be expected for a doubly-linked list. Operations that index into the list will traverse the list from the beginning or the end, whichever is closer to the specified index.

Answer from Eran on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › dsa › introduction-to-doubly-linked-lists-in-java
Introduction to Doubly Linked Lists in Java - GeeksforGeeks
April 25, 2023 - To create a doubly linked list, first, we need to define a Node class that has three data members that will store the data stored in the node, the reference to the next node, and the reference to the previous node.
Discussions

[Java] Implementing an ordered doubly linked list
A linked list is a data structure in which each individual piece of data, which are called links or nodes, keeps track of the other elements in the list. The advantage of this design is that elements can be added or removed at any point very easily. Whereas in an indexed array, all succeeding elements have to be shifted when an element is added or removed, in a linked list, only a few pointers have to modified when performing such operations. The downside of that we lose all forms of indexing. Below is an example of a Node class designed for a singly-linked list, or one in which each node keeps track of the next link only: /** * A simple node implementation for a singly-linked list. * * @param The type of element to store in this Node. */ class Node { /** Stores the data for this Node */ E item; /** Stores the next Node in the structure. */ Node nextLink; /** * Constructs a new Node with the given arguments. * * @param element The data for this Node. * @param next The next link in the list. */ Node(E element, Node next) { item = element; nextLink = next; } } Before introducing a doubly-linked structure, let's take a look at a simple, singly-linked list implementation: /** * A simple singly-linked list. * * @param The type of element to store in this LinkedList. */ class LinkedList { /** Points to the first link in the structure. */ Node firstLink; /** Points to the last link in the structure. */ Node lastLink; /** Stores the size of this list */ int size; /** Constructs a new, empty LinkedList. */ public LinkedList() { } // Other methods not shown. } Because each individual link in the structure stores a reference to the next element, our data structure class needs only to keep track of where the list begins and where it ends. Generally, the last link stores a null reference as its next link, i.e. lastLink.nextLink == null. Additionally, we should make size an instance variable in LinkedList so that any objects of we create will have an independent amount of elements. If your instructor allows it, you might want to extend the AbstractSequentialList class with your LinkedList if you need help with what methods you should have. To quickly recap, in a singly-linked list, each node, as in the imposed Node class above, stores a reference to the next element. Such a structure can only be traversed forwards, a limitation which is oftentimes an issue. To remedy this, we can make each node keep track of the previous node as well as the next node, creating what's called a doubly-linked list: /** * A simple node implementation for a doubly-linked list. * * @param The type of element to store in this Node. */ class Node { /** Stores the previous Node in the structure. */ Node previousLink; /** Stores the data for this Node */ E item; /** Stores the next Node in the structure. */ Node nextLink; /** * Constructs a new Node with the given arguments. * * @param previous The previous link in the list. * @param element The data for this Node. * @param next The next link in the list. */ Node(Node previous, E element, Node next) { previousLink = previous; item = element; nextLink = next; } } This is essentially all that needs to change to "upgrade" our LinkedList to a doubly-linked structure, which can be traversed both backwards and forwards. In general, the first node should store a null reference as its previous link, and the last link should store a null reference as its next link. If you haven't worked with Iterators before, take a look at the Iterator and ListIterator Javadocs. An Iterator is usually placed inside the class of a particular data structure and provides for a means of traversal. In the case of our doubly-linked list, we'll need to create two Iterators, one that traverses forwards and one that traverses backwards. I'll leave the implementation up to you, but the simplest way to do this is as follows: /** List Iterator with elements in the proper sequence. */ private class LLIterator implements ListIterator { private Node lastReturned = null; private Node next; private int nextIndex @Override public int previousIndex() { // TODO } @Override public int nextIndex() { // TODO } @Override public boolean hasPrevious() { // TODO } @Override public E previous() { // TODO } @Override public boolean hasNext() { // TODO } @Override public E next() { // TODO } @Override public void remove() { // TODO (optional) } @Override public void add(E e) { // TODO (optional) } @Override public void set(E e) { // TODO (optional) } } /** List Iterator with elements in descending sequence. */ private class DescendingIterator implements Iterator { private final LLIterator iterator = new LLIterator(); @Override public boolean hasNext() { return iterator.hasPrevious(); } @Override public E next() { return iterator.previous(); } @Override public boolean remove() { return iterator.remove(); } } More on reddit.com
🌐 r/learnprogramming
4
2
February 20, 2015
Java doubly linked list

If it's empty you can just check if head is null otherwise you're trying to access something inside of null, which doesn't exist.

And what do you mean head.next is your first element? Head shouod be your first element. And tail should be your last element. Heads previous node shouod be null, and the tail elements next value should be null. Seems like you're doing it a little weird. So let's look at a simple change of head as an example. Say you have 3 elements you can assign you can create a new node, point itd next value at the current head, then change head to the new node. Tail is just reverse.

So if your list is empty (head is null) to append all you need to do is

 head = new Node(data);

next and prev should already be null upon creation

More on reddit.com
🌐 r/programminghelp
2
2
April 17, 2019
I can't make the double linked list my assignment is requesting, is this a bad sign for me as a programmer?
Jesus mate. You don't need to question your ambitions just because you're stuck on an assignment your peers seem to pass. Ask for some damn help. Learning by yourself can only get you so far. If I'm stuck, I re-read the assignment, make sure to create a solid foundation and solve exactly as stated in the assignment. Last resort you can try reading and understanding what the junit tests do. Most of all, get some damn sleep More on reddit.com
🌐 r/AskProgramming
24
18
October 3, 2021
Linked List problems : need help to develop an understanding
Following questions would help. Did you study Comp Organization, Architecture ? A machine memory model? Those are necessary to understand the physical reality of LinkedList. Essentially memory and Pointers. This book here talks about Linked List in absolute details. https://theswissbay.ch/pdf/Gentoomen%20Library/Algorithms/Algorithms%20in%20C.pdf#page=32 The 2nd OG book. The first OG book would be Knuth, and here it is describing LinkedList. www.haio.ir/app/uploads/2022/01/The-Art-of-Computer-Programming-Vol.-1-Fundamental-Algorithms-3rd-Edition-by-Donald-E.-Knuth-z-lib.org_.pdf#page=254 Incidentally Sidgewick got his PHD from Donald Knuth. More on reddit.com
🌐 r/developersIndia
9
8
June 6, 2024
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › util › LinkedList.html
LinkedList (Java SE 17 & JDK 17)
April 21, 2026 - public class LinkedList<E> extends AbstractSequentialList<E> implements List<E>, Deque<E>, Cloneable, Serializable · Doubly-linked list implementation of the List and Deque interfaces.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › util › LinkedList.html
LinkedList (Java Platform SE 8 )
July 21, 2026 - Java™ Platform Standard Ed. 8 ... public class LinkedList<E> extends AbstractSequentialList<E> implements List<E>, Deque<E>, Cloneable, Serializable · Doubly-linked list implementation of the List and Deque interfaces.
🌐
Codecademy
codecademy.com › learn › linear-data-structures-java › modules › doubly-linked-lists-java › cheatsheet
Linear Data Structures: Doubly Linked Lists Cheatsheet | Codecademy
Doubly linked lists in Java utilize an updated Node class that has a pointer to the previous node. This comes with additional setter and getter methods for accessing the previous node.
🌐
Medium
medium.com › @ariel.salem1989 › data-structures-linked-list-doubly-linked-list-f8cf1b1c9f28
Data Structures — Linked List & Doubly Linked List | by Ariel Salem | Medium
May 30, 2017 - Doubly Linked List As was mentioned earlier, a Doubly Linked List is a Linked List that has capacity to remember its previous node, thereby allowing information to travel from the head to the tail and vice versa.
Find elsewhere
🌐
W3Schools
w3schools.com › java › java_linkedlist.asp
Java LinkedList
LinkedList stores elements as linked nodes, making inserts and removals fast.
🌐
Princeton University
algs4.cs.princeton.edu › 13stacks › DoublyLinkedList.java.html
DoublyLinkedList.java
August 11, 2022 - /*****************************... Dependencies: StdOut.java * * A list implemented with a doubly linked list. The elements are stored * (and iterated over) in the same order that they are inserted....
🌐
Scaler
scaler.com › home › topics › doubly linked list in java
Doubly Linked List in Java - Scaler Topics
April 19, 2024 - The doubly linked list is a data structure that has a set of linked nodes attached to each other in a sequential manner such that once can traverse both ways from a node (i.e. if we are at a node X we can go to the node previous of X or we can go to the node that is followed by X. Note: Each ...
🌐
OpenDSA
opendsa-server.cs.vt.edu › ODSA › Books › CS3 › html › ListDouble.html
5.6. Doubly Linked Lists — CS3 Data Structures & Algorithms
Here is the complete implementation for a Link class to be used with doubly linked lists. This code is a little longer than that for the singly linked list node implementation since the doubly linked list nodes have an extra data member. Java ·
🌐
W3Schools
w3schools.com › dsa › dsa_data_linkedlists_types.php
DSA Linked Lists Types
It takes up less space in memory because each node has only one address to the next node, like in the image below. A doubly linked list has nodes with addresses to both the previous and the next node, like in the image below, and therefore takes ...
🌐
Baeldung
baeldung.com › home › java › java list › creating a custom linked list data structure in java
Creating a Custom Linked List Data Structure in Java | Baeldung
April 22, 2025 - Circular linked list – The last node’s reference points back to the head, forming a loop. It can be singly or doubly linked.
🌐
InfoWorld
infoworld.com › home › software development › programming languages › java
Data structures and algorithms in Java, Part 5: Doubly-linked lists | InfoWorld
June 8, 2018 - DECLARE CLASS Node DECLARE STRING name DECLARE Node next DECLARE Node prev END DECLARE DECLARE Node topForward DECLARE Node temp DECLARE Node topBackward topForward = NEW Node topForward.name = "A" temp = NEW Node temp.name = "B" topBackward = NEW Node topBackward.name = "C" // Create forward singly-linked list topForward.next = temp temp.next = topBackward topBackward.next = NULL // Create backward singly-linked list topBackward.prev = temp temp.prev = topForward topForward.prev = NULL // Delete Node B. temp.prev.next = temp.next; // Bypass Node B in the forward singly-linked list. temp.next.prev = temp.prev; // Bypass Node B in the backward singly-linked list. END · The example Java application DLLDemo demonstrates how to create, insert, and delete nodes in a doubly-linked list.
🌐
GeeksforGeeks
geeksforgeeks.org › dsa › doubly-linked-list
Doubly Linked List Tutorial - GeeksforGeeks
September 19, 2025 - The main advantage of a doubly linked list is that it allows for efficient traversal of the list in both directions. This is because each node in the list contains a pointer to the previous node and a pointer to the next node.
🌐
Medium
medium.com › @manoharjanaarthan › mastering-doubly-linked-lists-in-java-a-complete-implementation-guide-6d5b2be98e9c
🚀 Mastering Doubly Linked Lists in Java: A Complete Implementation Guide | by Janaarthan Manohar | Medium
November 23, 2025 - When working with Data Structures and Algorithms in Java, the Doubly Linked List often emerges as a powerful choice for applications requiring efficient bidirectional traversal.
🌐
Reddit
reddit.com › r/learnprogramming › [java] implementing an ordered doubly linked list
r/learnprogramming on Reddit: [Java] Implementing an ordered doubly linked list
February 20, 2015 -

This is a HW assignment, so if that's discouraged here I can take it over to r/HomeworkHelp, but since this is dedicated to programming I thought I'd get better, faster responses here. Anyway...

So the assignment is to implement a doubly linked DoubleOrderedList class. The assignment states that I need to create three other classes, DoubleNode, DoubleList, DoubleIterator. Googling has led to a few useful results, but most have the structure in one or two classes, and I'm having a hard time understanding how create/use the other classes. Here's what my understanding is.

DoubleOrderedList - main class, and will "use" (i want to say implement, but I'm not sure, on the terminology, is import better?) the other three classes. So no structure definitions, it only contains stuff from the other classes.

DoubleNode - contains methods and data for creating each new node. So this video is my main source, and the beginning sets up what I think my DoubleNode class should be. So here's what came of that

 public class DoubleNode<T> {

static int numElements = 0;

private T data;

DoubleNode previous;
DoubleNode next;

public DoubleNode(T data) {
	this.data = data;
	numElements++;
}

}

seems simple enough, this class just defines a single node, and has nothing to do with interacting with any other Nodes yes?

DoubleList - I don't know what to do with this. is this just a basic double linked list? if so then will it implement/import DoubleNode?

DoubleIterator - defines the iterators that will traverse the list. I'm not sure how to create Iterators that will travel back and forward. Will it be only 1 iterator method? If so then it would have to utilize the prev and next references to move around the list right?

any help or references would be appreciated, thanks.

Top answer
1 of 2
1
A linked list is a data structure in which each individual piece of data, which are called links or nodes, keeps track of the other elements in the list. The advantage of this design is that elements can be added or removed at any point very easily. Whereas in an indexed array, all succeeding elements have to be shifted when an element is added or removed, in a linked list, only a few pointers have to modified when performing such operations. The downside of that we lose all forms of indexing. Below is an example of a Node class designed for a singly-linked list, or one in which each node keeps track of the next link only: /** * A simple node implementation for a singly-linked list. * * @param The type of element to store in this Node. */ class Node { /** Stores the data for this Node */ E item; /** Stores the next Node in the structure. */ Node nextLink; /** * Constructs a new Node with the given arguments. * * @param element The data for this Node. * @param next The next link in the list. */ Node(E element, Node next) { item = element; nextLink = next; } } Before introducing a doubly-linked structure, let's take a look at a simple, singly-linked list implementation: /** * A simple singly-linked list. * * @param The type of element to store in this LinkedList. */ class LinkedList { /** Points to the first link in the structure. */ Node firstLink; /** Points to the last link in the structure. */ Node lastLink; /** Stores the size of this list */ int size; /** Constructs a new, empty LinkedList. */ public LinkedList() { } // Other methods not shown. } Because each individual link in the structure stores a reference to the next element, our data structure class needs only to keep track of where the list begins and where it ends. Generally, the last link stores a null reference as its next link, i.e. lastLink.nextLink == null. Additionally, we should make size an instance variable in LinkedList so that any objects of we create will have an independent amount of elements. If your instructor allows it, you might want to extend the AbstractSequentialList class with your LinkedList if you need help with what methods you should have. To quickly recap, in a singly-linked list, each node, as in the imposed Node class above, stores a reference to the next element. Such a structure can only be traversed forwards, a limitation which is oftentimes an issue. To remedy this, we can make each node keep track of the previous node as well as the next node, creating what's called a doubly-linked list: /** * A simple node implementation for a doubly-linked list. * * @param The type of element to store in this Node. */ class Node { /** Stores the previous Node in the structure. */ Node previousLink; /** Stores the data for this Node */ E item; /** Stores the next Node in the structure. */ Node nextLink; /** * Constructs a new Node with the given arguments. * * @param previous The previous link in the list. * @param element The data for this Node. * @param next The next link in the list. */ Node(Node previous, E element, Node next) { previousLink = previous; item = element; nextLink = next; } } This is essentially all that needs to change to "upgrade" our LinkedList to a doubly-linked structure, which can be traversed both backwards and forwards. In general, the first node should store a null reference as its previous link, and the last link should store a null reference as its next link. If you haven't worked with Iterators before, take a look at the Iterator and ListIterator Javadocs. An Iterator is usually placed inside the class of a particular data structure and provides for a means of traversal. In the case of our doubly-linked list, we'll need to create two Iterators, one that traverses forwards and one that traverses backwards. I'll leave the implementation up to you, but the simplest way to do this is as follows: /** List Iterator with elements in the proper sequence. */ private class LLIterator implements ListIterator { private Node lastReturned = null; private Node next; private int nextIndex @Override public int previousIndex() { // TODO } @Override public int nextIndex() { // TODO } @Override public boolean hasPrevious() { // TODO } @Override public E previous() { // TODO } @Override public boolean hasNext() { // TODO } @Override public E next() { // TODO } @Override public void remove() { // TODO (optional) } @Override public void add(E e) { // TODO (optional) } @Override public void set(E e) { // TODO (optional) } } /** List Iterator with elements in descending sequence. */ private class DescendingIterator implements Iterator { private final LLIterator iterator = new LLIterator(); @Override public boolean hasNext() { return iterator.hasPrevious(); } @Override public E next() { return iterator.previous(); } @Override public boolean remove() { return iterator.remove(); } }
2 of 2
1
Try just making the double node class first...
🌐
Upgrad
upgrad.com › home › blog › software development › doubly linked list implementation in c and java: a comprehensive guide
Doubly Linked List Implementation in C & Java: Easy Steps & Code Examples
July 6, 2026 - This hands-on approach in C allows for better control over memory and is why C is preferred in systems programming and embedded systems. A doubly linked list node holds three components: data, next pointer, and prev pointer.
🌐
AlgoMaster
algomaster.io › animations › dsa
DSA Animation | AlgoMaster.io | AlgoMaster.io
Deep copy a linked list with random pointers using three-pass interleaving · Medium · Flatten a multilevel doubly linked list by inserting child lists inline · Easy · Find the node where two linked lists intersect using two pointers · Medium · Add two numbers represented as linked lists where digits are stored forward ·