| 1 | Start quickSort on full array | [10, 7, 8, 9, 1, 5] | N/A | N/A | Full array: [10,7,8,9,1,5] |
| 2 | Choose pivot | [10, 7, 8, 9, 1, 5] | 5 | Prepare partition around 5 | Contains elements <5 (1) and >5 |
| 3 | Partition step | [1, 7, 8, 9, 10, 5] | 5 | Swap 10↔1, then 5↔7 | Array after partition: [1,5,8,9,10,7] |
| 4 | Pivot placed at index 1 | [1, 5, 8, 9, 10, 7] | 5 | Pivot 5 in correct place | Left subarray: [1], Right subarray: [8,9,10,7] |
| 5 | Recurse left subarray | [1] | N/A | Single element, no action | Sorted left subarray: [1] |
| 6 | Recurse right subarray | [8, 9, 10, 7] | 7 | Choose pivot 7 | Partition around 7 |
| 7 | Partition step | [1, 5, 7, 9, 10, 8] | 7 | Swap 8↔7 (pivot to pos 2) | Full array after partition: [1,5,7,9,10,8] |
| 8 | Pivot placed at index 2 | [1, 5, 7, 9, 10, 8] | 7 | Pivot 7 in correct place | Left subarray: [], Right subarray: [9,10,8] |
| 9 | Recurse left subarray | [] | N/A | Empty subarray, no action | Sorted left subarray: [] |
| 10 | Recurse right subarray | [9, 10, 8] | 8 | Choose pivot 8 | Partition around 8 |
| 11 | Partition step | [1, 5, 7, 8, 10, 9] | 8 | Swap 9↔8 (pivot to pos 3) | Full array after partition: [1,5,7,8,10,9] |
| 12 | Pivot placed at index 3 | [1, 5, 7, 8, 10, 9] | 8 | Pivot 8 in correct place | Left subarray: [], Right subarray: [10,9] |
| 13 | Recurse left subarray | [] | N/A | Empty subarray, no action | Sorted left subarray: [] |
| 14 | Recurse right subarray | [10, 9] | 9 | Choose pivot 9 | Partition around 9 |
| 15 | Partition step & combine | [1, 5, 7, 8, 9, 10] | 9 | Swap 10↔9 (pivot to pos 4) | Final sorted array: [1,5,7,8,9,10] |
| 16 | End | [1, 5, 7, 8, 9, 10] | N/A | Sorting complete | Sorted array returned |