Skip to main content

Basic Operations

Essential operations for working with linked lists effectively.

Traversal & manipulation

  • Linear Traversal: Visit each node sequentially
  • Conditional Traversal: Traverse based on specific conditions
  • Reverse Traversal: Process nodes from end to beginning
  • Multi-pass Traversal: Multiple iterations for complex operations

Node insertion & deletion

  • Insertion: Add new nodes at beginning, middle, or end
  • Deletion: Remove nodes while maintaining list integrity
  • Position-based Operations: Insert/delete at specific positions
  • Value-based Operations: Insert/delete nodes with specific values

List reversal

  • Iterative Reversal: Reverse list using iterative approach
  • Recursive Reversal: Reverse list using recursion
  • Partial Reversal: Reverse specific portion of list
  • In-place Reversal: Reverse without extra space

Cycle detection

  • Floyd's Algorithm: Detect cycle using fast and slow pointers
  • Cycle Length: Find length of cycle if present
  • Cycle Start: Find starting node of cycle
  • Cycle Removal: Remove cycle from linked list

List merging

  • Merge Two Sorted Lists: Combine two sorted linked lists
  • Merge K Sorted Lists: Merge multiple sorted lists
  • In-place Merging: Merge without creating new list
  • Merge with Constraints: Merge with specific requirements