logo

Crowdly

Browser

Додати до Chrome

Algoritmos e Estruturas de Dados - LEI 2026-2027

Шукаєте відповіді та рішення тестів для Algoritmos e Estruturas de Dados - LEI 2026-2027? Перегляньте нашу велику колекцію перевірених відповідей для Algoritmos e Estruturas de Dados - LEI 2026-2027 в moodle.fct.unl.pt.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

Qual a complexidade temporal do método allDiff no melhor caso? //

What is the best-case time complexity of the method allDiff?

/**

*

* @param numbers : an array that is filled up to position n-1

* @return true iff all the numbers are different

*/

public static boolean allDiff(int[] numbers,int n) {

int i=0;

while (i<n && diff(numbers[i],numbers,i,n))

i++;

return i==n;

}

private static boolean diff(int number, int[] numbers, int pos, int n) {

int i=pos+1;

while (i<n && number!=numbers[i])

i++;

return i==n;

}

100%
0%
0%
0%
0%
Переглянути це питання

Considere um algoritmo que tem taxa de execução T( n ) = 10 n2 + 50 n2

Este algoritmo é (escolha todas as opções correctas).

//

Consider an algorithm that has execution rate T( n ) = 10 n2 + 50 n2

This algorithm is (choose all options that apply).

0%
0%
100%
0%
Переглянути це питання

Imagine que tem um programa P implementado, que recebe como input n

números. Ao experimentar executá-lo com testes aleatorizados, obteve os seguintes tempos de execução:

  • Com n=300

    demorou 1.5 segundos

  • Com n=600

    demorou 6.0 segundos

  • Com n=1200

    demorou 24 segundos

Qual será a complexidade temporal mais provável do programa P?

//

Imagine you have an implemented program P, which receives n numbers as input. When you run it with randomized tests, you get the following execution times:

With n=300, it took 1.5 seconds

With n=600, it took 6.0 seconds

With n=1200, it took 24 seconds

What is the most likely time complexity of program P?

0%
100%
0%
0%
0%
Переглянути це питання

Qual situação representa um cenário de melhor caso do método allDiff? //

Which situation represents a best-case scenario for the method allDiff?

/**

*

* @param numbers : an array that is filled up to position n-1

* @return true iff all the numbers are different

*/

public static boolean allDiff(int[] numbers,int n) {

int i=0;

while (i<n && diff(numbers[i],numbers,i,n))

i++;

return i==n;

}

private static boolean diff(int number, int[] numbers, int pos, int n) {

int i=pos+1;

while (i<n && number!=numbers[i])

i++;

return i==n;

}

0%
0%
0%
100%
0%
Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.fct.unl.pt?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome