update(commentaire): todo
This commit is contained in:
parent
f79c13e454
commit
465b24bbfa
1 changed files with 3 additions and 0 deletions
|
@ -26,6 +26,7 @@ fn tri(n: usize, arr: &mut [u32]) -> Result<(), &str> {
|
||||||
while i < n {
|
while i < n {
|
||||||
tmp = arr[i];
|
tmp = arr[i];
|
||||||
j = i;
|
j = i;
|
||||||
|
|
||||||
while j < n {
|
while j < n {
|
||||||
if tmp > arr[j] {
|
if tmp > arr[j] {
|
||||||
arr[i] = arr[j];
|
arr[i] = arr[j];
|
||||||
|
@ -39,10 +40,12 @@ fn tri(n: usize, arr: &mut [u32]) -> Result<(), &str> {
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
// TODO faire des meilleurs test
|
||||||
let mut test : [u32; 5] = [5, 2, 1, 4, 5];
|
let mut test : [u32; 5] = [5, 2, 1, 4, 5];
|
||||||
match tri(5, &mut test) {
|
match tri(5, &mut test) {
|
||||||
Ok(_) => { println!("Tableau = {:?}", test) }
|
Ok(_) => { println!("Tableau = {:?}", test) }
|
||||||
|
|
Loading…
Reference in a new issue