FlowLab Logo

Linked List Search Visualizer

SlowFast
515
(8)
Current (Examined)
Target Value
Found
Other
Operation Logs
No operations yet
Algorithm Info
Time Complexity: O(n) - must visit each node
Space Complexity: O(1)
Best Case: O(1) - target at head
Worst Case: O(n) - not found or last node
How it works: Traverses each node from head, checking value.
When to use: Unsorted, linked data structures, or when array random access is not available.
Implementation
function linkedListSearch(head, target) {
  let curr = head;
  while (curr) {
    if (curr.value === target) return true;
    curr = curr.next;
  }
  return false;
}