Linked Lists - freeCodeCamp

Nilesh Saini
1 min readMay 29, 2022

--

My notes from this tutorial

Photo by Fuu J on Unsplash

Todos:

  1. Linked List
  2. Traversal
  3. Sum of all the values
  4. Find a value
  5. Get node value
  6. Reverse the linked list
  7. Merging two linked lists

Linked List:

A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements in a linked list are linked using pointers. In simple words, a linked list consists of nodes where each node contains a data field and a reference(link) to the next node in the list.

A linked list is represented by a pointer to the first node of the linked list. The first node is called the head. If the linked list is empty, then the value of the head points to NULL.

Each node in the linked list has at least two parts:

  • Data/value like string, integer or data of any type
  • Pointer/Reference to the next node

Note: read about linked lists vs arrays

Linked List Traversal:

Iterative

Recursive

Sum of Linked List:

Iterative

Recursive

Find a Value in a Linked List

Iterative

Recursive

Get the Node Value:

Iterative

Recursive

Reverse a Linked List

Iterative

Recursive

Merging Lists (Zipper list problem)

Iterative

Recursive

--

--

Nilesh Saini
Nilesh Saini

Written by Nilesh Saini

Web Developer/ Front-end engineer who loves solving Rubik's Cube

Responses (1)