Skip to content

Commit 635eb55

Browse files
committed
buble sort algorithm updated
1 parent 11e6d67 commit 635eb55

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

sorting_algorithms.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,6 @@ class SortingAlgorithms:
55

66
# Bubble Sort Implementation
77
@staticmethod
8-
# def bubble_sort(dataset, draw_data, speed, stop_flag):
9-
# # comparisons counter
10-
# comparisons = 0
11-
# for i in range(len(dataset)):
12-
# for j in range(len(dataset) - i - 1):
13-
# if stop_flag():
14-
# return
15-
# comparisons += 1
16-
# if dataset[j] > dataset[j + 1]:
17-
# # swap elements
18-
# dataset[j], dataset[j + 1] = dataset[j + 1], dataset[j]
19-
# draw_data(dataset, ['#019267' if c == j or c == j + 1 else 'red' for c in range(len(dataset))])
20-
# time.sleep(speed)
21-
#
22-
# draw_data(dataset, ['#019267' for i in range(len(dataset))])
23-
# return comparisons
248
def bubble_sort(dataset, draw_data, speed, stop_flag):
259
# comparisons counter
2610
comparisons = 0

0 commit comments

Comments
 (0)