#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 21 17:06:13 2022

@author: leprince
"""


def pivotage(T,g,d):
    pivot = T[g]
    i = g+1 # indice du premier non trait\'e
    indp = g #future place du pivot (dernier <= pivot dans partie trait\'ee)
    while i < ... :
        if T[i] <= pivot:
            ....
            indp +=1
        i+=1    
    T[g] , T[indp] = ....       
    return indp  

def triRapideEnPlacePart(T,g,d):
    # cas de base : si d-g <= 1, on ne fait rien
    if d-g > 1:
        m = pivotage(T,g,d) #affecte \`a m l'indice du pivot 
                            #et effectue le pivotage sur T
        ...
        ...
        

def triRapideEnPlace(T):
    ...


#test
T = [4,9,7,0,1,2,5,3,6,8]
triRapideEnPlace(T)
print(T)
