logo

Crowdly

25_HESSO-VS_SI_Informatique SYND

Looking for 25_HESSO-VS_SI_Informatique SYND test answers and solutions? Browse our comprehensive collection of verified answers for 25_HESSO-VS_SI_Informatique SYND at cyberlearn.hes-so.ch.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

What is the space complexity (BigO) of this algorithm?

Note: the algorithm is described in pseudo-code. 'directory' is the path (String) to a folder containing n images.

In your calculation, do NOT consider the space used by the input array.

An 'image' is a an array of size [512][512][3] (width, height, channels)

loadImages(directory)

    images <- empty list

    files <- list all files in directory

    for each file in files

        image <- load file into memory

        images.append(image)

    return images

0%
0%
0%
0%
0%
View this question

What is the Big O time complexity of a loop that iterates until a certain condition is met, where the condition is checked within the loop?

Example :

//...

Scanner scanner = new Scanner(System.in);

int number;

do {

    System.out.print("Enter a positive number: ");

    number = scanner.nextInt();

    } while (number <= 0);

System.out.println("You entered: " + number);

//...

0%
0%
0%
100%
View this question

What is the Big O time complexity of a loop that iterates n times and where the complexity of operations increases linearly with each iteration?

Example :

for (int i = 0; i < n; i++) {

   for (int j = 0; j < i; j++) {

      System.out.println("Hello World!");

   }

}

0%
100%
0%
0%
View this question

What is the Big O time complexity of a loop that iterates n times and performs constant operations in the body of the loop?

Example:

for (int i = 0; i < n; i++) {

    System.out.println("Hello World!");

}

0%
0%
0%
100%
View this question

Quelle est la complexité spatiale de cet algorithme (Big O) ?

Wie hoch ist die räumliche Komplexität dieses Algorithmus (Big O)?

Exemple/Beispiel:

int[][][] list = new int[3][2][1];

for (int i = 0; i<list.length; i++){

for (int j = 0; j<list[i].length; j++){

int sum = 0;

for (int k = 0; k<list[i][j].length; k++){

sum += k;

}

list[i][j][0] = sum;

}

}

0%
0%
100%
0%
View this question

Quelle est la complexité spatiale de cet algorithme (Big O) ?

Wie hoch ist die räumliche Komplexität dieses Algorithmus (Big O)?

Exemple/Beispiel:

int[][] list = new int[n][3*n];

for (int i = 0; i<list.length; i++){

for (int j = 0; j<list[i].length; j++){

int sum = 0;

for (int k = 0; k < n; k++){

sum += k;

}

list[i][j] = sum;

}

}

View this question

Quelle est la complexité spatiale de cet algorithme (Big O) ?

Wie hoch ist die räumliche Komplexität dieses Algorithmus (Big O)?

Exemple/Beispiel:

ArrayList<Integer> list = new ArrayList<>();

Random rand = new Random();

for (int i = 0; i<n; i++){

list.add(rand.nextInt());

}

System.out.println(list);

View this question

Quelle est la complexité en temps de cet algorithme (Big O) ?

Wie hoch ist die Zeitkomplexität

dieses

Algorithmus (Big O)?

Exemple/Beispiel:

int j = 0;

int x = 0;

do {

x = 5*j - 2;

j++;

} while (x >= 0);

View this question

Quelle est la complexité en temps de cet algorithme (Big O) ?

Wie hoch ist die Zeitkomplexität

dieses

Algorithmus (Big O)?

Exemple/Beispiel:

boolean condition = true;

int i = 0;

while (condition){

System.out.println("Step: " + i++);

if (i == 4*n){

condition = false;

}

}

View this question

Quelle est la complexité en temps de cet algorithme (Big O) ?

Wie hoch ist die Zeitkomplexität

dieses

Algorithmus (Big O)?

Exemple/Beispiel:

String stars = "";

for (int i = 0; i < n; i++) {

    for (int j = 0; j < n; j++){

        for (int k = 0; k < 4; k++){       

            stars += "*";

        }

    }

}

System.out.println(stars);

View this question

Want instant access to all verified answers on cyberlearn.hes-so.ch?

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