Linked Lists

Linear data structure where elements are stored in nodes that point to the next node.

Back to Data Structures
linked-lists
easy

What is a singly linked list?

Click to flip

A singly linked list is a linear data structure where each element (node) contains data and a reference to the next node in the sequence. The last node points to null.

class Node {
  constructor(data) {
    this.data = data;
    this.next = null;
  }
}
Click to flip back
linked-listsingly-linked-list
1 of 2