Skip to content
Felipe Ribeiro edited this page Feb 18, 2014 · 7 revisions

Definition

In computer science, a linked list is a data structure consisting of a group of nodes which together represent a sequence. Under the simplest form, each node is composed of a datum and a reference (in other words, a link) to the next node in the sequence; more complex variants add additional links. This structure allows for efficient insertion or removal of elements from any position in the sequence.

In a doubly linked list, each node contains, besides the next-node link, a second link field pointing to the previous node in the sequence. The two links may be called forward(s) and backwards, or next and prev(ious).

Source: Wikipedia

Code: https://github.com/felipernb/algorithms.js/blob/master/data_structures/linked_list.js

Tests: https://github.com/felipernb/algorithms.js/blob/master/test/data_structures/linked_list.js

Clone this wiki locally