Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以下の質問に対する私の答えに少し自信がありません。助けてください:
N 個の整数のリストが与えられたとします。1 つを除くすべての整数が数値順にソートされます。この特殊なケースを O(N) 時間でソートするソート アルゴリズムを特定し、このソート アルゴリズムがこのケースで O(N) ランタイムを達成する理由を説明してください。
挿入ソートだと思いますが、なぜそうなのかはわかりません。
ありがとう!!