<jupyter_start><jupyter_text>Quick SortDivide and Conquer algorithm: O(n logn)- pick a pivot, make sure [left nums] < pivot < [right nums] by swapping- repeat on [left nums] and [right nums]<jupyter_code>def partition(arr, low, high): 
    i = low - 1 # index of smaller element 
    pivot = arr[high] # pivot
    for j in range(low, high):
        if arr[j] <= pivot:  
            i = i + 1
            arr[i], arr[j] = arr[j], arr[i] # swap
    arr[i+1], arr[high] = arr[high], arr[i+1] 
    return i + 1
def quickSort(arr, low, high): 
    if len(arr) == 1: return arr
    if low < high: 
        piv = partition(arr, low, high) 
        quickSort(arr, low, piv - 1) 
        quickSort(arr, piv + 1, high)

arr = [10, 7, 8, 9, 1, 5]
quickSort(arr, 0, len(arr) - 1)
print(arr)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14709517923362175, 'fraction_numerical': 0.021013597033374538, 'mean_word_length': 2.7155963302752295, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '263058', 'license': 'MIT', 'n_tokens_mistral': 330, 'n_tokens_neox': 300, 'n_words': 98, 'path': '.ipynb_checkpoints/Python-Sort-checkpoint.ipynb', 'repo_name': 'longwangjhu/LeetCode', 'size': '809'}