
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
Similar Resources on Wayground
28 questions
Excel

Quiz
•
12th Grade
20 questions
Java Arrays

Quiz
•
9th - 12th Grade
20 questions
APCSA Arrays

Quiz
•
9th - 12th Grade
19 questions
Python Итоговый тест

Quiz
•
1st - 12th Grade
20 questions
Arduino UNO

Quiz
•
12th Grade
20 questions
PH - KLS 12 BAB 1

Quiz
•
12th Grade
20 questions
קלט פלט משתנים והוראות השמה

Quiz
•
7th Grade - University
20 questions
Unit 6 ArrayLists and String Methods

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade