Salelá algorithme ya kosala triage rapide mpo na ko classer array oyo epesami.
Quick-sort ezali algorithme ya triage ya divide-and-conquer oyo esalaka na kopona élément pivot na kati ya array mpe kokabola ba éléments mosusu na ba sous-arrays mibale selon soki ezali moke to eleki pivot. Na nsima, ba sous-arrays esalemaka na ndenge ya récursive. Tala implémentation na python: ```python def quick_sort(arr): soki len(arr) <= 1: zongisa arr soki te: pivot = arr[0] moins = [x pona x na arr[1:] soki x <= pivot ] monene = [x mpo na x na arr[1:] soki x > pivot ] zongisa quick_sort(moke) + [pivot] + quick_sort(monene) # Code ya mokumbi arr = [4, 3, 5, 9, 1 ] print("Array original:", arr) arr = quick_sort(arr) print("Array oyo ebongisami:", arr) ``` Code oyo ekosala sortie oyo: ``` Array original: [4, 3, 5 , 9, 1] Sorted array: [1, 3, 4, 5, 9] ``` Misala oyo eponaka élément ya liboso ya array lokola pivot, kasi ba stratégies ekeseni ekoki kosalelama, lokola kopona élément aléatoire, the médiane to même élément ya kati. Pona pivot ekoki kozala na impact na performance ya algorithme.