Created
January 9, 2019 02:21
-
-
Save vincecima/bf503ddaff327c52be1f66ddeb51b5d8 to your computer and use it in GitHub Desktop.
Code Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def method(a) | |
n=a.length | |
for i in 0...n-1 | |
for j in 0...n-i-1 | |
if a[j]>a[j+1] | |
temp=a[j] | |
a[j]=a[j+1] | |
a[j+1]=temp | |
end | |
end | |
end | |
return a | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment