Complete the code to initialize the low pointer to start the partition.
let low = [1];The low pointer starts at index 0 to begin partitioning from the start of the array.
Complete the code to swap elements at indices i and low.
let temp = arr[[1]]; arr[[2]] = arr[low]; arr[low] = temp;
We swap the element at index i with the element at index low to move smaller elements to the front.
Fix the error in the while loop condition to correctly process the array.
while (i [1] high) {
The loop should run while i is less than or equal to high to process all elements.
Fill both blanks to correctly update pointers after swapping smaller elements.
swap(arr, i, low); [1]++; [2]++;
After swapping, both i and low pointers move forward to continue partitioning.
Fill the blanks to correctly update pointers after swapping larger elements.
swap(arr, i, [1]); [2]--; // decrement high pointer // do not increment i here
Swap with high, decrement high pointer, and do not increment i to recheck swapped element.
