logo

Crowdly

Browser

Add to Chrome

Qual a complexidade temporal do método allEqual no melhor caso, sendo n=numbers...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Qual a complexidade temporal do método allEqual no melhor caso, sendo n=numbers.length? //

What is the best-case time complexity of the method allEquals, where n=numbers.length?

/**

*

* @param numbers : array that completely full

* @return

*/

public static boolean allEqual(int[] numbers) {

int x=numbers[0];

int i=1;

while (i<numbers.length && x==numbers[i])

i++;

return i==numbers.length;

}

0%
0%
100%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.fct.unl.pt?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome