Skip to content · ⁨コンテンツへスキップ⁩
English

Putting items in order

  • Sorting arranges a list into order, usually smallest first.
  • The key move is a swap: exchange two items.
  • In Python: a[i], a[j] = a[j], a[i] swaps two list items in one line.
日本語

順序付け

  • ソートとは、リストを通常は最小値から始まるように並べ替えることです。
  • 主要な操作はスワップ:2つの要素を入れ替えることです。
  • Pythonでは:a[i], a[j] = a[j], a[i]で1行目にリストの2つの要素を入れ替えられます。

Handout · ⁨プリント⁩

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP