Skip to content

Instantly share code, notes, and snippets.

@tolpp
Last active August 29, 2015 14:15
Show Gist options
  • Save tolpp/404288218998a512b1be to your computer and use it in GitHub Desktop.
Save tolpp/404288218998a512b1be to your computer and use it in GitHub Desktop.
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