<jupyter_start><jupyter_text>Quick Sort<jupyter_code>from typing import List
from random import randint, sample
def quick_sort(arr: List[int], i: int = 0, j: int = None) -> List[int]:
    def partition(left: int, pivot: int, right: int) -> int:
        while left <= right:
            if arr[left] > arr[pivot] and arr[right] <= arr[pivot]:
                arr[left], arr[right] = arr[right], arr[left]
            else:
                if arr[left] <= arr[pivot]:
                    left += 1
            
                if arr[right] > arr[pivot]:
                    right -= 1
        
        arr[pivot], arr[right] = arr[right], arr[pivot]
        return right
    
    j = j if j != None else len(arr) - 1
    if i < j:
        pivot = partition(i, (j - i) // 2 + i, j)
        quick_sort(arr, i, pivot - 1)
        quick_sort(arr, pivot + 1, j)
        
    return arr
quick_sort(list(sample(range(0,100), 10)))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13760504201680673, 'fraction_numerical': 0.01365546218487395, 'mean_word_length': 1.8791540785498488, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '450036', 'license': 'MIT', 'n_tokens_mistral': 334, 'n_tokens_neox': 314, 'n_words': 88, 'path': 'quick_sort.ipynb', 'repo_name': 'adnanyaqoobvirk/data-structures-and-algorithms', 'size': '952'}