Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. 1. Take the first input from the source and put it in array a (a[0])
  2. 2. Take the next input from the source and put it at the end of the array (a[n] where n is the total number of elements retrieved from the source)
  3. 3. Set x is equal to n – 2
  4. 4. If a[x] is less than a[x + 1], swap the values of a[x] and a[x + 1].
  5. 5. Decrement x by 1
  6. 6. Repeat steps 4 to 5 until x is 0.
  7. 7. Repeat steps 2 to 6 for all input from the source.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement