Skip to content
Snippets Groups Projects
Commit 06661aec authored by Martin Mareš's avatar Martin Mareš
Browse files

04: Ještě bublinkové třídění

parent ee9cdab0
Branches
No related tags found
No related merge requests found
#!/usr/bin/env python3
# Třídění probubláváním
x = [31, 41, 59, 26, 53, 58, 97]
n = len(x)
for i in range(n):
for j in range(n-1):
if x[j] > x[j+1]:
x[j], x[j+1] = x[j+1], x[j]
print(x)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment