Шукаєте відповіді та рішення тестів для 25_HESSO-VS_SI_Informatique SYND? Перегляньте нашу велику колекцію перевірених відповідей для 25_HESSO-VS_SI_Informatique SYND в cyberlearn.hes-so.ch.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
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
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);
//...
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!"); }}
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!");
}
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; }}
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; }}
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);
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);
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; }}
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);
Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!