Algoritmo y estrucutura de datos S4

Algoritmo y estrucutura de datos S4

12th Grade

10 Qs

quiz-placeholder

Similar activities

G8 Practice PC

G8 Practice PC

12th Grade

15 Qs

Matrices

Matrices

7th Grade - Professional Development

10 Qs

Arrays Intro

Arrays Intro

9th - 12th Grade

12 Qs

Skill Development - Debugging Practice1

Skill Development - Debugging Practice1

10th Grade - Professional Development

10 Qs

Instrukcja for z zagnieżdżeniem (C++)

Instrukcja for z zagnieżdżeniem (C++)

KG - University

7 Qs

C++ Programming Quiz

C++ Programming Quiz

12th Grade

10 Qs

Loops

Loops

9th - 12th Grade

10 Qs

Java: repetition control structure for & while

Java: repetition control structure for & while

10th - 12th Grade

10 Qs

Algoritmo y estrucutura de datos S4

Algoritmo y estrucutura de datos S4

Assessment

Quiz

Computers

12th Grade

Hard

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?