I'm trying to find the time complexity of the following function:
for (int i = 0; i < arraySize; i++) {
for (int j = 0; j < arraySize; j++) {
if (array[j] < array[i]) {
//Do something
}
else if (array[j] == array[i]) {
//Do something else
}
}
}
I think it is O(n^2), but I'm not sure how to prove it.