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 15 Linked List Search Algorithms

procedure FindByElement(element,headelement, head)

currentheadcurrent \gets head

while currentNULLcurrent \neq \text{NULL} do

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

return true\text{true}

currentcurrent.nextcurrent \gets current.next

return false\text{false}

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

if index<0index < 0 or indexnindex \ge n then

return NULL\text{NULL}

currentheadcurrent \gets head

for i0 to index1i \gets 0 \text{ to } index - 1 do

currentcurrent.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 16 Doubly Linked List Insertion

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

if index==0index == 0 then

newnode.nextheadnewnode.next \gets head

head.prevnewnodehead.prev \gets newnode

headnewnodehead \gets newnode

else if index==sizeindex == size then

newnode.prevtailnewnode.prev \gets tail

tail.nextnewnodetail.next \gets newnode

tailnewnodetail \gets newnode

else

currheadcurr \gets head

for i0 to index2i \gets 0 \text{ to } index - 2 do

currcurr.nextcurr \gets curr.next

newnode.nextcurr.nextnewnode.next \gets curr.next

newnode.prevcurrnewnode.prev \gets curr

curr.nextnewnodecurr.next \gets newnode

newnode.next.prevnewnodenewnode.next.prev \gets newnode

sizesize+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 17 Doubly Linked List Removal

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

if index==0index == 0 then

headhead.nexthead \gets head.next

head.prevNULLhead.prev \gets \text{NULL}

if index==n1index == n - 1 then

tailtail.prevtail \gets tail.prev

tail.nextNULLtail.next \gets \text{NULL}

else

currheadcurr \gets head

for i0 to index2i \gets 0 \text{ to } index - 2 do

currcurr.nextcurr \gets curr.next

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

curr.next.prevcurrcurr.next.prev \gets curr

nn1n \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