small fixes

This commit is contained in:
2025-06-23 17:00:58 +02:00
parent e15715f86d
commit 26598fe6f2
6 changed files with 36 additions and 46 deletions

View File

@@ -1,13 +1,11 @@
func quicksort[arr: Array] : I64
do_quicksort(arr, 0, Array.size(arr)-1)
return 0
func do_quicksort[arr: Array, low: I64, high: I64] : I64
if low < high
let i: I64 = partition(arr, low, high)
do_quicksort(arr, low, i - 1)
do_quicksort(arr, i + 1, high)
return 0
func partition[arr: Array, low: I64, high: I64] : I64
let pivot: I64 = Array.nth(arr, high)