Last active
July 6, 2016 20:48
-
-
Save RamonLopezEscudero/567448e1cbf553feb2b23c12c302b8ab to your computer and use it in GitHub Desktop.
Ordenamiento de datos por el algoritmo "Bubblesort"
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
list = [23, 17, 5, 90, 12, 44, 38, 84, 77, 1] | |
n = len(list) | |
for i in range(n - 1): | |
for j in range(n - 1): | |
if list[j] < list[j+1]: | |
pass | |
else: | |
temp = list[j+1] | |
list[j+1] = list[j] | |
list[j] = temp | |
print list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment