Guest User

Untitled

a guest
May 26th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. # Pseudo-code for a simple sorting algorithm.
  2. # For each position on the list, runs through
  3. # the remainder of the list and swaps when
  4. # a smaller element is encountered.
  5.  
  6. sort(list) {
  7. size = array_size(numbers)
  8. i, k
  9.  
  10. for i in [1, size] {
  11. for k in [i+1, size] {
  12. if numbers[i] > numbers[k]
  13. then swap(numbers, i, k)
  14. }
  15. }
  16. return numbers
  17. }
Add Comment
Please, Sign In to add comment