Abstract

Developed in 1955 by Allen Newell, Cliff Shaw, and Herbert A. Simon at RAND Corporation, the linked list is a dynamically allocated data structure that grows as needed in memory. It bypasses the contiguous allocation constraints of standard Array Lists by linking scattered node containers via explicit system pointers.

  • Category: Dynamic Linked Structures
  • Core Node Anatomy: Formed of an internal data value paired with directional address pointers.
  • Entry Constraints: Direct access is restricted to boundary head and tail pointers; finding interior elements requires sequential traversal.

Structural Variations

Linked Lists are configured into two primary architectural variants based on pointer depth:

Architectural FeatureSingly-Linked ListDoubly-Linked List
Pointers per Node1 (Points exclusively forward to the next node)2 (Points symmetrically to next and previous nodes)
Traversal DirectionUnidirectional (Forward only)Bidirectional (Forward and backward)
Termination BoundsFinal node’s next reference points to NULLhead.prev and tail.next point to NULL

Structural Illustrations

Access Limitations Complexity

If direct structural references are limited to head or tail markers, finding a node inside a Linked List containing elements incurs an linear time complexity, as the system must step through the pointer chain node-by-node.


Core Operations

Searching & Value Traversal

Finding an item or resolving an index requires sequential traversal from boundary references.

  • Time Complexity: worst-case.
  • Optimization: In a Doubly-Linked List, if the requested index sits closer to the trailing margin, the routine can start at the tail and step backward to halve traversal overhead.

Algorithm 17 Linked List Search Algorithms

procedure FindByElement(element,headelement, head)

current←headcurrent \gets head

while current≠NULLcurrent \neq \text{NULL} do

if current.data==elementcurrent.data == element then

return true\text{true}

current←current.nextcurrent \gets current.next

return false\text{false}

procedure FindByIndex(index,head,nindex, head, n)

if index<0index < 0 or index≥nindex \ge n then

return NULL\text{NULL}

current←headcurrent \gets head

for i←0 to index−1i \gets 0 \text{ to } index - 1 do

current←current.nextcurrent \gets current.next

return current

Element Insertion

Inserting an element requires locating the node preceding the target position and updating neighboring pointers to splice in the new node container.

  • Time Complexity: at boundary margins (head/tail); for internal positions due to the traversal cost of locating the insertion site.

Algorithm 18 Doubly Linked List Insertion

procedure Insert(newnode,index,head,tail,sizenewnode, index, head, tail, size)

if index==0index == 0 then

newnode.next←headnewnode.next \gets head

head.prev←newnodehead.prev \gets newnode

head←newnodehead \gets newnode

else if index==sizeindex == size then

newnode.prev←tailnewnode.prev \gets tail

tail.next←newnodetail.next \gets newnode

tail←newnodetail \gets newnode

else

curr←headcurr \gets head

for i←0 to index−2i \gets 0 \text{ to } index - 2 do

curr←curr.nextcurr \gets curr.next

newnode.next←curr.nextnewnode.next \gets curr.next

newnode.prev←currnewnode.prev \gets curr

curr.next←newnodecurr.next \gets newnode

newnode.next.prev←newnodenewnode.next.prev \gets newnode

size←size+1size \gets size + 1

Element Removal

Bypasses a targeted node by linking its preceding and succeeding neighbors directly to each other.

  • Time Complexity: at boundary edges; for internal nodes.

Algorithm 19 Doubly Linked List Removal

procedure Remove(index,head,tail,nindex, head, tail, n)

if index==0index == 0 then

head←head.nexthead \gets head.next

head.prev←NULLhead.prev \gets \text{NULL}

if index==n−1index == n - 1 then

tail←tail.prevtail \gets tail.prev

tail.next←NULLtail.next \gets \text{NULL}

else

curr←headcurr \gets head

for i←0 to index−2i \gets 0 \text{ to } index - 2 do

curr←curr.nextcurr \gets curr.next

curr.next←curr.next.nextcurr.next \gets curr.next.next

curr.next.prev←currcurr.next.prev \gets curr

n←n−1n \gets n - 1

Memory Cleanup Realities

In the removal diagram, the decoupled node remains stranded in system space. From a strict data structure interface perspective, this does not break functionality because the item is unreachable. However, in non-garbage-collected environments (like C++), you must explicitly delete the unlinked node to avoid memory leaks.


Architectural Comparison Matrix

Technical FeatureLinked List ImplementationArray List Implementation
Access / Search Cost linear pointer sequence traversal random access / sorted binary search
Head Insert / Delete quick pointer reassignment swap linear data block shifting
Tail Insert / Delete direct pointer assignmentAmortized capacity shifting
Memory FootprintDynamic growth layout; no empty pre-allocated slotsBounded continuous chunks; can leave unused margins
Pointer OverheadHigher cost due to storing address referencesMinimal cost; tracks data elements only

Related Notes