Computer Science II Final Exam
A ________ function is one that calls itself A) dynamic B) static C) recursive D) data validation E) None of these - Answer-C) recursive Recursion can be used to: A) compute factorials B) find GCD's C) traverse linked lists D) All of these E) None of these - Answer-D) All of these The ________ algorithm uses recursion to efficiently sort a list. A) shell sort B) quicksort C) binary sort D) red/black sort E) None of these - Answer-B) quicksort If a recursive function does not contain a base case, it ________. A) returns 0 and stops B) returns false and stops C) uses up all available stack memory, causing the program to crash D) reaches the recursive case and stops E) None of these - Answer-C) uses up all available stack memory, causing the program to crash The ________ of recursion is the number of times a recursive function calls itself. A) level B) breadth C) type D) depth E) None of these - Answer-D) depth The programmer must ensure that a recursive function does not become: A) a static function B) a virtual function C) an endless loop D) a dynamic function E) None of these - Answer-C) an endless loop How many times will the following function call itself, if the value 5 is passed as the argument?
Geschreven voor
- Instelling
- Computer Science II F
- Vak
- Computer Science II F
Documentinformatie
- Geüpload op
- 13 maart 2024
- Aantal pagina's
- 25
- Geschreven in
- 2023/2024
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
-
computer science ii final exam