100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Examen

Data Structures Exam Questions and Answers

Puntuación
-
Vendido
-
Páginas
8
Grado
A+
Subido en
29-07-2025
Escrito en
2024/2025

Data Structures Exam Questions and Answers data structure - Answer- a collection of data organized in some fashion data structure - Answer- supports for accessing and manipulating the data data structure - Answer- an object that stores other objects, referred to as data or elements True or False to define a data structure is to essentially define a class - Answer- True To create a list to store integers, use A. ArrayList<Object> list = new ArrayList<>(); B. ArrayList<Integer> list = new ArrayList<>(); C. ArrayList<int> list = new ArrayList<int>(); D. ArrayList<Number> list = new ArrayList<>(); - Answer- B. ArrayList<Integer> list = new ArrayList<>(); Suppose List<String> list = new ArrayList<String>(). Which of the following operations are correct? (new Integer(100)); (new ArrayList()); ("Red"); (new .Date()); - Answer- ("Red"); Which of the following is a correct statement to sort the elements in a list called lst ? C(lst) A(lst) new LinkedList(new String[]{"red", "green", "blue"}) () - Answer- C(lst) Given the following statement, what is the best way to find a maximum object in an array of strings ? String[] names = {"red", "green", "blue"}) C(names) A(names) C(AList(names)) A(names) - Answer- C(AList(names)) True or False: A recursive call can result in many more recursive calls, because the method keeps on dividing a subproblem into new subproblems. - Answer- True Which of the following statements are characteristics of recursive methods ? The method is implemented using an if-else or a switch statement that leads to different cases.

Mostrar más Leer menos
Institución
Data Structures Dsa
Grado
Data structures dsa









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Data structures dsa
Grado
Data structures dsa

Información del documento

Subido en
29 de julio de 2025
Número de páginas
8
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

data structure - Answer- a collection of data organized in some fashion

data structure - Answer- supports for accessing and manipulating the data

data structure - Answer- an object that stores other objects, referred to as data or
elements

True or False to define a data structure is to essentially define a class - Answer-
True

To create a list to store integers, use
A. ArrayList<Object> list = new ArrayList<>();
B. ArrayList<Integer> list = new ArrayList<>();
C. ArrayList<int> list = new ArrayList<int>();
D. ArrayList<Number> list = new ArrayList<>(); - Answer- B. ArrayList<Integer> list
= new ArrayList<>();

Suppose List<String> list = new ArrayList<String>().
Which of the following operations are correct?
ist.add(new Integer(100));
list.add(new ArrayList());
list.add("Red");
list.add(new java.util.Date()); - Answer- list.add("Red");

Which of the following is a correct statement to sort the elements in a list called lst ?
Collections.sort(lst)
Arrays.sort(lst)
new LinkedList(new String[]{"red", "green", "blue"})
lst.sort() - Answer- Collections.sort(lst)

Given the following statement, what is the best way to find a maximum object in an
array of strings ?
String[] names = {"red", "green", "blue"})
Collections.max(names)
Arrays.max(names)
Collections.max(Arrays.asList(names))
Arrays.sort(names) - Answer- Collections.max(Arrays.asList(names))

True or False: A recursive call can result in many more recursive calls, because the
method keeps on dividing a subproblem into new subproblems. - Answer- True

Which of the following statements are characteristics of recursive methods ?
The method is implemented using an if-else or a switch statement that leads to
different cases.

, One or more base cases (the simplest case) are used to stop recursion.
Every recursive call reduces the original problem, bringing it increasingly closer to a
base case until it becomes that case.
All of these are characteristics of a recursive method - Answer- All of these are
characteristics of a recursive methods

True or False: Any problem that can be solved recursively can be solved non
recursively with iterations. - Answer- True

Recursive methods need _____________ time and memory to execute than non
recursive methods. - Answer- more

True or False: Any recursive method can be converted into a non recursive method.
- Answer- True

Recursive programs can run out of memory, causing a _________
logic error
syntax error
end of file error
stack overflow error - Answer- Stack flow error

_________________ occurs when method 1 invokes method 2, which in turn
invokes method 1 - Answer- Indirect recursion

What lets you parameterize types? - Answer- Generics

True or False: The motivation for using Java generics is to detect errors at compile
time. - Answer- True

True or False: A generic type can be defined for a class or interface. A concrete type
must be specified when using the class to create an object or using the class or
interface to declare a reference variable. - Answer- True

To declare a generic method, you place the _________________ immediately after
the keyword static in the method header.
instances
generic type <E>
actual type
subtype - Answer- generic type <E>

True or False: A generic type can be defined for a static method. - Answer- True

You can use _________________ wildcards, bounded wildcards, or lower-bound
wildcards to specify a range for a generic type. - Answer- Unbounded

The information on generics is used by the compiler but is not available at runtime. -
Answer- type erasure
$15.99
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Freshy Oxford University
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
53
Miembro desde
1 año
Número de seguidores
4
Documentos
6784
Última venta
2 semanas hace

3.6

10 reseñas

5
3
4
4
3
1
2
0
1
2

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes