Skip to content

Commit 7d2d0c2

Browse files
finding best time by bubble sort.
1 parent 7e14677 commit 7d2d0c2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Bsort.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
seconds = [66, 57, 54, 53, 64, 52, 59]
2+
3+
n = len(seconds)
4+
5+
for i in range(n):
6+
for j in range(0,n-i-1):
7+
if seconds[j] > seconds[j+1]:
8+
seconds[j], seconds[j+1] = seconds[j+1], seconds[j]
9+
10+
print("her best time is", seconds[0],"seconds")

0 commit comments

Comments
 (0)