Examlex

Solved

What Is the Complexity of the Following Code (In Terms

question 7

Short Answer

What is the complexity of the following code (in terms of the length of the array), assuming someMethod has a complexity of O(1)?
for(int i = 0; i < array.length; i++)
for(int j = 0; j < array.length; j++)
someMethod(array[j]);


Definitions:

Related Questions