Skip to content

Resource · Guide or article

Linked List

Singly linked list basics, including the tradeoff against arrays (linear access time, weaker cache locality), with pseudocode for the operations interviewers usually ask about.

Reviewed

Open the original: Linked List (opens the original site in a new tab)

Practice this topicOpens the practice interviewer in Technical / coding mode; choose a question there.

Add to a roadmap

Keep this resource with a roadmap you follow. It appears as your own extra resource; the roadmap's steps don't change and it doesn't count toward your tracked steps.

Source content: English

Read this in other languages: 简体中文, Русский, 日本語, Português, 한국어, Español, Türkçe, Українська In computer science, a linked list is a linear collection of data elements, in which linear order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a group of nodes which together represent a sequence. Under the simplest form, each node is composed of data and a reference (in other words, a link) to the next node in the sequence. This structure allows for efficient insertion or removal of elements from any position in the sequence during iteration. More complex variants add additional links, allowing efficient insertion or removal from arbitrary element references. A drawback of linked lists is that access time is linear (and difficult to pipeline). Faster access, such as random access, is not feasible. Arrays have better cache locality as compared to linked lists.

PrepKit overview

PrepKit editors wrote and reviewed this overview from the source repository. It is not text from the resource itself.

Suited to
The source does not state a level
Format
Reference

What it covers

  • Pseudocode for Add at the tail and Prepend at the head, keeping head and tail pointers
  • Contains search and Remove by value, including the tail update
  • Forward traversal, plus a quadratic reverse traversal that finds each previous node from the head
  • Complexity table: access and search O(n), insertion O(1), deletion O(n), space O(n)

How to use it

PrepKit study advice, not a claim made by the source.

Implement every pseudocode block, then write an in-place reversal; the page does not include one. Test it on lists of length 0, 1 and 5.

Scope and limitations

No classic interview problems such as cycle detection or in-place reversal, and the reverse traversal shown is the slow nested-loop version.

Access and format

README on GitHub, trekhleb/javascript-algorithms (MIT); eight translations are linked. English, free to read.

Reviewed by PrepKit on Oct 2, 2026. Listing source commit: 85293e3e2b88

Evidence behind this overview
  • src/data-structures/linked-list/README.md

Pages that include this

Get the PrepKit newsletter

Optional. You don't need it to use PrepKit.

How we handle your email