Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created August 30, 2019 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todorok1/e66cdc7e2e4d5712f16341bb369898d6 to your computer and use it in GitHub Desktop.
Save todorok1/e66cdc7e2e4d5712f16341bb369898d6 to your computer and use it in GitHub Desktop.
バブルソートアルゴリズムのC#実装の実行例。
元の配列
26, 400, 19, 504, 8, 500, 58, 14, 401, 168, 13
処理中の様子
1週目の処理 : 26, 19, 400, 8, 500, 58, 14, 401, 168, 13, 504
2週目の処理 : 19, 26, 8, 400, 58, 14, 401, 168, 13, 500, 504
3週目の処理 : 19, 8, 26, 58, 14, 400, 168, 13, 401, 500, 504
4週目の処理 : 8, 19, 26, 14, 58, 168, 13, 400, 401, 500, 504
5週目の処理 : 8, 19, 14, 26, 58, 13, 168, 400, 401, 500, 504
6週目の処理 : 8, 14, 19, 26, 13, 58, 168, 400, 401, 500, 504
7週目の処理 : 8, 14, 19, 13, 26, 58, 168, 400, 401, 500, 504
8週目の処理 : 8, 14, 13, 19, 26, 58, 168, 400, 401, 500, 504
9週目の処理 : 8, 13, 14, 19, 26, 58, 168, 400, 401, 500, 504
10週目の処理 : 8, 13, 14, 19, 26, 58, 168, 400, 401, 500, 504
11週目の処理 : 8, 13, 14, 19, 26, 58, 168, 400, 401, 500, 504
*** 最終結果 ***
8, 13, 14, 19, 26, 58, 168, 400, 401, 500, 504
処理回数は 55 回でした。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment