Algoritmo y estrucutura de datos S4

Quiz
•
Computers
•
12th Grade
•
Hard

Carlos Matute
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
1. Para inicializar un arreglo de enteros en Java, puedes usar: int[] numbers = new int[___];
10
a,b,c
10,2,c
true
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
2. Para buscar un elemento en un array, puedes usar un bucle como este: for(int i = 0; i < numbers.length; i++) { if(numbers[i] == ___) { return i; }}
elementIndex
searchValue
targetValue
currentValue
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
3. Para agregar un elemento a un array, necesitas crear un nuevo array con un tamaño mayor y copiar los elementos. El código se ve así: int[] newArray = new int[___]; for(int i = 0; i < oldArray.length; i++) { newArray[i] = oldArray[i]; }
oldArray.length * 2
oldArray.length - 1
oldArray.length + 1
oldArray.length + 2
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
4. Para encontrar el valor máximo en un arreglo, puedes usar: int max = ___; for(int i = 0; i < array.length; i++) { if(array[i] > max) { max = array[i]; }}
int max = Integer.MIN_VALUE;
int max = array[0];
int max = array[array.length - 1];
int max = 0;
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
1. ¿Cuál es la forma correcta de crear una matriz de enteros en Java con 3 filas y 4 columnas?
int[][] matriz = new int[3][4];
int matriz[][] = new int[3,4];
int matriz[3][4];
int matriz = new int[3][4];
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
2. ¿Qué código se utiliza para mostrar una matriz triangular superior en Java?
for(int i = 0; i < matriz.length; i++) { for(int j = i; j < matriz[i].length; j++) { System.out.print(matriz[i][j] + " "); } }
for(int i = 0; i < matriz.length; i++) { for(int j = 0; j < matriz[i].length; j++) { if(i > j) System.out.print(matriz[i][j] + " "); } }
for(int i = 0; i < matriz.length; i++) { for(int j = 0; j < matriz[i].length; j++) { System.out.print(matriz[j][i] + " "); } }
for(int i = 0; i < matriz.length; i++) { for(int j = 0; j < matriz[i].length; j++) { if(i < j) System.out.print(matriz[i][j] + " "); } }
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
3. ¿Qué hace el siguiente código en Java: int[][] matriz = new int[5][5]; for(int i = 0; i < 5; i++) { for(int j = 0; j < 5; j++) { if(i == j) matriz[i][j] = 1; else matriz[i][j] = 0; }}
Crea una matriz de ceros.
Crea una matriz identidad de 5x5.
Crea una matriz triangular inferior.
Crea una matriz triangular superior.
Create a free account and access millions of resources
Similar Resources on Wayground
8 questions
Robotics Quiz

Quiz
•
1st - 12th Grade
10 questions
Java while loops

Quiz
•
10th - 12th Grade
14 questions
C++ - Loops and Random Numbers

Quiz
•
9th - 12th Grade
10 questions
Introduction to Arrays

Quiz
•
KG - University
15 questions
Control statements in C++

Quiz
•
9th - 12th Grade
10 questions
Java: repetition control structure for & while

Quiz
•
10th - 12th Grade
15 questions
G8 Practice PC

Quiz
•
12th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade