Last active
August 29, 2015 14:15
-
-
Save tolpp/404288218998a512b1be to your computer and use it in GitHub Desktop.
This file contains hidden or 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
procedure bubbleSort( A : sıralanacak eleman dizisi ) | |
n = length(A) | |
do | |
newn = 0 | |
swapped = false | |
for (i = 0; i < n-1; i++) do: | |
if A[i] <; A[i+1] then | |
swap(A[i], A[i+1]) | |
newn = i + 1 | |
swapped = true | |
end if | |
end for | |
n = newn | |
while n > 1 and not swapped | |
end procedure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment