
Funzioni Ricorsive
Quiz
•
Computers
•
12th Grade
•
Hard
F M
FREE Resource
24 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cosa si intende per caso base in una funzione ricorsiva?
La chiamata finale alla funzione
Il parametro della funzione
La condizione in cui la funzione smette di chiamare sé stessa
Il tipo di ritorno della funzione
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In una funzione ricorsiva, quale delle seguenti affermazioni è vera?
Il caso ricorsivo viene eseguito per primo
Il caso base deve essere evitato
Il caso base impedisce la ricorsione infinita
La ricorsione si ferma dopo 5 chiamate
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cosa sono i parametri formali in una funzione?
I valori passati dal main
Le variabili locali
Le variabili dichiarate tra parentesi tonde nella definizione della funzione
Le costanti
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Qual è la relazione tra parametri attuali e formali?
Non c'è nessuna relazione
I parametri attuali inizializzano quelli formali
Sono la stessa cosa
I parametri formali vengono passati come costanti
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Il codice seguente rappresenta una funzione ricorsiva corretta:
int funzione(int n) {
if (n <= 0)
return 0;
else
return funzione(n);
}
Sì
No, manca il caso base
No, la funzione non termina
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Completare la funzione somma per sommare i primi N interi:
int somma(int N) {
if (N == 0)
return 0;
else
return ___________;
}
N + somma(N)
N + somma(N - 1)
somma(N - 1)
N * somma(N - 1)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cosa restituisce somma(3) con questa funzione?
int somma(int N) {
if (N == 0) return 0;
else return N + somma(N - 1);
}
3
6
0
9
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple

Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
20 questions
APCS_A_Week1_Gloria
Quiz
•
9th - 12th Grade
20 questions
Python while loops
Quiz
•
12th Grade
19 questions
программирование
Quiz
•
9th Grade - University
20 questions
EXCEL
Quiz
•
12th Grade
20 questions
Array
Quiz
•
10th - 12th Grade
20 questions
for Döngüsü
Quiz
•
10th - 12th Grade
20 questions
Functions
Quiz
•
9th - 12th Grade
25 questions
C++ Programming Unit 3 Quiz
Quiz
•
10th - 12th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade