1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
   |  
function sortTable()
{
   comparisons = ind -1  // ind est le nombre totale des elements
   while(comparisons > 0)
   {
      position = 0
 
      while(position < comparisons)
      {
          if(tab1[position] == "IS NOT CLOSED")
          {
             position++
             continue
          }
 
          if(tab1[position + 1] == "IS NOT CLOSED")
          {
            exchange(position)  // fonction pour echanger les elements successif
            position++
            continue
          }
 
          difference = diff(tab1[position],tab1[position+ 1])
 
          if(difference < 0)
            exchange(position)
          position++
      }
 
     comparisons--
   }
} | 
Partager