Anonymous user
Sorting algorithms/Bubble sort: Difference between revisions
→[[Python]]: removed off-topic example, changed formatting
(→[[Ruby]]: removed off-topic example) |
(→[[Python]]: removed off-topic example, changed formatting) |
||
Line 178:
==[[Python]]==
[[Category:Python]]
def bubblesort(seq):▼
for i in xrange(len(seq) - 2):
▲def bubblesort(seq):
for
data = [3, 78, 4, 23, 6, 8, 6]▼
bubblesort(data)▼
▲data = [3, 78, 4, 23, 6, 8, 6]
print data # [3, 4, 6, 6, 8, 23, 78]▼
▲bubblesort(data)
▲print data # [3, 4, 6, 6, 8, 23, 78]
==[[Ruby]]==
|