Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Take the first input from the source and put it in array a (a[0])
- 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. Set x is equal to n – 2
- 4. If a[x] is less than a[x + 1], swap the values of a[x] and a[x + 1].
- 5. Decrement x by 1
- 6. Repeat steps 4 to 5 until x is 0.
- 7. Repeat steps 2 to 6 for all input from the source.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement