Programme de Tri par insertion sur Matlab :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 function T=ex3(T) p=2; while p>=1 p=0; for i=1:length(T)-1 if T(i)>T(i+1) aux=T(i); T(i)=T(i+1); T(i+1)=aux; p=p+1; end end end T
Partager