Big O analysis Flashcards
1
Q
The space complexity of function considers space taken by the inputs. True or false?
A
False
2
Q
What is the space complexity?
public static int getLargestItem(int[] items) {
int largest = Integer.MIN_VALUE;
for (int item : items) {
if (item > largest) {
largest = item;
}
}
return largest;
}
A
O(1)