Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bubble Sort Psuedocode
- Int array[10]; create an array of 10 intergers and load with data
- Move 0 to x
- Move 0 to y
- [Improved] Move 1 to count
- Perform loop1 until x > 9 [Improved] OR count = 0
- [Improved] Move 0 to count
- Perform loop2 until y > 8
- Compare array[y] to array[y+1]
- If array[y] is larger than array[y+1]
- [Improved] Add 1 to count
- Move array[y] to hold
- Move array[y+1] to array[y]
- Move hold to array[y+1]
- End if
- Increase y by 1
- End loop2
- [Improved]
- Increase x by 1
- Move 0 to y
- Subtract 1 from top
- End loop1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement