Dubbsta
Active member
- Joined
- Jul 13, 2017
- Messages
- 208
would someone be kind enough to write some sorting algos? mainly selection and merge
i copied this from the web and it looks right on but getting bad results. i tried tracing it in my head but if i try one more time i think my head might explode.
i copied this from the web and it looks right on but getting bad results. i tried tracing it in my head but if i try one more time i think my head might explode.
Code:
For Local i:Int = 0 Until arr.Length()-1
Local min:Int = i
For Local j:Int = 1 Until arr.Length()
If arr[j] < arr[min]
min = j
End
Local temp:Int = arr[i]
arr[i] = arr[min]
arr[min] = temp
DrawText(arr[i],20,20+i*10)
Next
next