バブルソート
bubble sort
code:b.mermaid
graph TD
A
Start
--> B
Get unsorted list
;
B --> C
Set swapped = true
;
C --> D{ While swapped is true};
D -- True --> E
Set swapped = false
;
E --> F
/For each item in the list, from first to second-to-last\
;
F --> G{Is current item > next item?};
G -- Yes --> H
Swap the items
;
H --> I
Set swapped = true
;
I --> J
\End of inner loop/
;
G -- No --> J;
J --> F;
F -- End of list --> D;
D -- False --> K
List is sorted
;
K --> L
End
;
joken
-
/joken/バブルソート
nishinojunji-public
-
/nishinojunji-public/バブルソート
pocala-kyopro
-
/pocala-kyopro/バブルソート
tkgshn
-
/tkgshn/バブルソート
renoretriever
-
/renoretriever/バブルソート
ia7ck-comp-pro
-
/ia7ck-comp-pro/バブルソートのswap回数
ソートアルゴリズム
https://ja.wikipedia.org/wiki/バブルソート