バブルソート
bubble sort
code:b.mermaid
graph TD
AStart --> BGet unsorted list;
B --> CSet swapped = true;
C --> D{ While swapped is true};
D -- True --> ESet 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 --> HSwap the items;
H --> ISet swapped = true;
I --> J\End of inner loop/;
G -- No --> J;
J --> F;
F -- End of list --> D;
D -- False --> KList is sorted;
K --> LEnd;
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/バブルソート