the first loop switches the i'th member backoward like in insertion sort till it gets a valuse smalle then maxvalue
but it switch always with a[i-2]
so i cant see the purpose
the second loop does a similar thing
but i cant see what is the general purpose
??