We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 11e6d67 + 635eb55 commit dde5e43Copy full SHA for dde5e43
sorting_algorithms.py
@@ -5,22 +5,6 @@ class SortingAlgorithms:
5
6
# Bubble Sort Implementation
7
@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
24
def bubble_sort(dataset, draw_data, speed, stop_flag):
25
# comparisons counter
26
comparisons = 0
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments