Advertisement
Neveles

Untitled

Dec 23rd, 2019
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. void insertionSort(Array<Book>& ob)
  2. {
  3.     for (int i = 0; i < ob.length(); ++i)
  4.         for (int j = i; j > 0 && ob[j - 1] < ob[j]; --j)
  5.         {
  6.             Book temp = ob[j - 1];
  7.             ob[j - 1] = ob[j];
  8.             ob[j] = temp;
  9.         }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement