proc bubble_sort . d[] .
   for i = len d[] - 1 downto 1
      for j = 1 to i
         if d[j] > d[j + 1]
            swap d[j] d[j + 1]
         .
      .
   .
.
arr[] = [ 5 1 19 25 12 1 14 7 ]
bubble_sort arr[]
print arr[]
