1
0
Fork 0

update(commentaire): todo

This commit is contained in:
rick 2021-07-24 03:45:42 +02:00
parent f79c13e454
commit 465b24bbfa
Signed by: Rick
GPG key ID: 2B593F087240EE99

View file

@ -26,6 +26,7 @@ fn tri(n: usize, arr: &mut [u32]) -> Result<(), &str> {
while i < n {
tmp = arr[i];
j = i;
while j < n {
if tmp > arr[j] {
arr[i] = arr[j];
@ -39,10 +40,12 @@ fn tri(n: usize, arr: &mut [u32]) -> Result<(), &str> {
i += 1;
}
}
Ok(())
}
fn main() {
// TODO faire des meilleurs test
let mut test : [u32; 5] = [5, 2, 1, 4, 5];
match tri(5, &mut test) {
Ok(_) => { println!("Tableau = {:?}", test) }