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

DSA Recursion Questions with Solved Answers

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

Exam of 2 pages for the course DSA at DSA (DSA Recursion)

Institución
DSA
Grado
DSA








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

Escuela, estudio y materia

Institución
DSA
Grado
DSA

Información del documento

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

Temas

Vista previa del contenido

DSA Recursion

1. If the user enters 10 in the triangle.java program (Listing 6.1), what is the maximum
number of "copies" of the triangle() method (actually just copies of its argument) that
exist at any one time? - answer10

2. Where are the copies of the argument, mentioned in question 1, stored?
a. in a variable in the triangle() method
b. in a field of the TriangleApp class
c. in a variable of the getString() method
d. on a stack - answerD

3. Assume the user enters 10 as in question 1. What is the value of n when the
triangle() method first returns a value other than 1? - answer2

4. Assume the same situation as in question 1. What is the value of n when the
triangle() method is about to return to main()? - answer10

5. True or false: In the triangle() method, the return values are stored on the stack. -
answerFalse

6. In the anagram.java program (Listing 6.2), at a certain depth of recursion, a version of
the doAnagram() method is working with the string "led". When this method calls a new
version of itself, what letters will the new version be working with? - answer"ed"

7. We've seen that recursion can take the place of a loop, as in the loop-oriented
orderedArray.java program (Listing 2.4) and the recursive binarySearch.java program
(Listing 6.3). Which of the following is not true?
a. Both programs divide the range repeatedly in half.
b. If the key is not found, the loop version returns because the range bounds cross, but
the recursive version occurs because it reaches the bottom recursion level.
c. If the key is found, the loop version returns from the - answerB

8. In the recFind() method in the binarySearch.java program (Listing 6.3), what takes
the place of the loop in the non-recursive version?
a. the recFind() method
b. arguments to recFind()
c. recursive calls to recFind()
d. the call from main() to recFind() - answerC

9. The binarySearch.java program is an example of the _________ approach to solving
a problem. - answerdivide-and conquer
$12.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


Documento también disponible en un lote

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.
Dreamer252 NBursing
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
477
Miembro desde
2 año
Número de seguidores
293
Documentos
21305
Última venta
1 semana hace

4.0

115 reseñas

5
60
4
22
3
18
2
2
1
13

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