最大値探索における空間計算量
直前の演習で実装したコードにおいて、findMaxValue メソッドの空間計算量はどれでしたか?
public int findMaxValue(int[] data) {
// Initialize the maximum value to the first element
int max = data[0];
for (int value : data) {
// Update max if current element is greater
if (value > max) {
max = value;
}
}
return max;
}
この演習はコースの一部です
