Skip to content

Instantly share code, notes, and snippets.

@Carmen195
Created March 23, 2025 19:18
Show Gist options
  • Save Carmen195/f725b8fe6226cbf36c133b27c294f682 to your computer and use it in GitHub Desktop.
Save Carmen195/f725b8fe6226cbf36c133b27c294f682 to your computer and use it in GitHub Desktop.
Nombres misteriosos buble sort
def b(l):
n = len(l)
for i in range(n):
for j in range(0, n-i-1):
if l[j] > l[j+1] :
l[j], l[j+1] = l[j+1], l[j]
# Ejemplo de uso
l = [64, 34, 25, 12, 22, 11, 90]
b(l)
print ("Lista ordenada:")
for i in range(len(l)):
print ("%d" % l[i]),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment