Flowcharts & Processes

How Lomuto Quicksort Partitioning Works

Flowcharts & Algorithms diagram · made in Skemio

Flowchart showing Lomuto Quicksort partitioning from picking the pivot to scanning elements, swapping smaller values, placing the pivot, and returning its final index.
Flowchart showing Lomuto Quicksort partitioning from picking the pivot to scanning elements, swapping smaller values, placing the pivot, and returning its final index.

What it shows

  • Chooses the last element as pivot and scans from left to right.
  • Maintains index i for items smaller than pivot, swapping on discovery.
  • Final swap puts pivot in its exact sorted spot in O(n) time.

The takeaway

Partitioning places one pivot into its permanent index in O(n) time without extra memory allocations.

More flowcharts & algorithms diagrams