for (int i =0; i < n; i++)
for (int j=0; j < n; j++)
if (a[i] < a[j]) swap(a,i,j);
for (int i=0; i < n; i++)
for (int j=i; j < n; j++)
if (a[i] < a[j]) swap(a,i,j);
for (int i=0; i < 10; i++) swap(a,i,1);
for (int step=n/2, int i=step; i; step/=2, i+=step) if (a[i] < key) step = abs(step); else if (a[i] > key) step = abs(step) * -1; else break;
for (int i=0; i < n; i++)
for (int j=n; j; j/=2)
a[i,j] = mark;