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
15 questions
CSE_CodeHS_intro_python_unit_3_5

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

Quiz
•
12th Grade
15 questions
Basics in Java

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

Quiz
•
10th - 12th Grade
13 questions
C++ Loops

Quiz
•
9th - 12th Grade
12 questions
Linguagem C parte II

Quiz
•
12th Grade
10 questions
Programming Basics

Quiz
•
11th - 12th Grade
10 questions
Python Data Types

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

Quiz
•
6th - 9th Grade