Complete the code to swap two elements in the array.
arr.swap([1], high);The swap function exchanges the element at index low with the element at index high to place the pivot correctly.
Complete the code to compare the current element with the pivot value.
if arr[j] [1] pivot_value {
We check if the current element is less than the pivot value to decide if it should be moved to the left partition.
Fix the error in the recursive call to sort the left partition.
quick_sort(arr, low, [1]);The left partition ends at pivot_index - 1 because the pivot is already in correct place.
Fill both blanks to complete the partition function header and return statement.
fn partition(arr: &mut [i32], [1]: usize, [2]: usize) -> usize {
The partition function takes the low and high indices to work on the subarray and returns the pivot index.
Fill all three blanks to complete the recursive quick_sort calls after partitioning.
quick_sort(arr, low, [1]); quick_sort(arr, [2], high);
After partitioning, quick_sort is called on the left subarray ending at pivot_index - 1 and the right subarray starting at pivot_index + 1.
