0
0

単純選択法(選択ソート)

Last updated at Posted at 2024-05-25

単純選択法(選択ソート)とは

データを並べ替える整列アルゴリズムの一つ。
一番小さなデータを選択して、先頭から順に並べ替えていく。

対象データ

以下の配列を昇順に並べ替える

$array = [12, 13, 11, 14, 10];

フローチャート

image.png

手順

①探索範囲の最小値を探す
②探索範囲の最小値を先頭要素と交換する

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0