times 'Bubble operation'. One 'Bubble operation' is like this:
for(int i = 1; i < n; ++i) { if(a[i] > a[i + 1]) swap(a[i], a[i + 1]); }
The sequence starts from 1, and its length is n.
times 'Bubble operation'. One 'Bubble operation' is like this:
for(int i = 1; i < n; ++i) { if(a[i] > a[i + 1]) swap(a[i], a[i + 1]); }
The sequence starts from 1, and its length is n.
1
5 1
5 4 3 2 1
4 3 2 1 5