Advertisement
Farhanhm

Untitled

Mar 8th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.23 KB | None | 0 0
  1. Void ReverseInsertionSort(int[] array)
  2. {
  3.     for (int i=0;i<array.length;i++)
  4.     {
  5.         int currentValue = array[i];
  6.         while (i>=1&&currentValue>array[i-1])
  7.         {
  8.             array[i]=array[i-1];
  9.             i--;
  10.         }
  11.         array[i]=currentValue;
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement