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.
次の問題のビッグオーは何ですか?
public static void mystery(int[] list) { for (int i = 0; i < list.length/2; i++) { int j = list.length-1-i; int temp = list[i]; list[i] = list[j]; list[j] = temp; } }
配列を 1 回だけループするため、O(n) です。