
Evaluare_recursivitate_XI
Authored by Carmen Preoteasa
Education
11th Grade
Used 5+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Funcţia F are definiţia alăturată. Ce valoare are F(3)?
int F(int n)
{
if(n==0 || n==1) return 1;
else
return 2*F(n-1)+2*F(n-2);
}
1
12
6
10
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Subprogramul f are definiţia alăturată. Ce se va afişa în urma apelului f(12345);?
void f(long n)
{
if (n>9)
{cout<<n/100;
f(n/10);
}
}
1231210
123121
1234123121
123
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Ce valoare are f(100)?
int f(int n)
{ if(n==0) return 0; else return n%2+f(n/2); }
16
3
10
30
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Pentru subprogramul suma definit alăturat, scrieţi valoarea expresiei suma(5,4).
int suma (int a,int b)
{ if (a==0 && b==0) return 0;
else
if (a==0) return 1+suma(a,b-1);
else return 1+suma(a-1,b);
}
10
20
9
18
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Se consideră subprogramul recursiv f1 definit alăturat. Ce se va afişa în urma apelului f1(5);?
void f1(int x)
{ if (x<=9)
{ cout<<x+1;
f1(x+2);
cout<<x+3;
}
}
68101
681012108
2108
68112108
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Subprogramul re este definit alăturat. Ce valoarea are re(1)? Dar re(14)?
int re(int i)
{ if (i<9) return 3+re(i+2);
else
if (i==9) return -2;
else return 1+re(i-1);
}
re(1)=10 re(14)=3
re(1)=3 re(14)=10
re(1)=3 re(14)=3
re(1)=10 re(14)=10
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Considerăm subprogramul f definit alăturat. Ce valoare are f(7,11)? Dar f(11,7)?
int f(int x,int y)
{ if(x<=y) return x-y; return f(y-x,x-1)+3; }
f(7,11)=-14 f(11,7)=-11
f(7,11)=-11 f(11,7)=-4
f(7,11)=-2 f(11,7)=-10
f(7,11)=-4 f(11,7)=-11
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
10 questions
ภาษาอังกฤษ
Quiz
•
10th - 12th Grade
10 questions
College Application Quiz
Quiz
•
11th Grade
10 questions
PTS Bahasa Indonesia 11 (Genap)
Quiz
•
11th Grade
10 questions
Soal CNC
Quiz
•
11th - 12th Grade
10 questions
Dinámica. Fuerza Aplicada y Fuerza de Fricción
Quiz
•
11th Grade - University
10 questions
Գրիգոր Նարեկացի
Quiz
•
10th - 12th Grade
10 questions
Tes Potensi Akademik
Quiz
•
10th - 12th Grade
10 questions
Excel
Quiz
•
10th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade
Discover more resources for Education
15 questions
Making Inferences
Quiz
•
7th - 12th Grade
23 questions
TSI Math Vocabulary
Quiz
•
10th - 12th Grade
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
15 questions
ACT Reading Practice
Quiz
•
11th Grade
80 questions
ACT Math Important Vocabulary
Quiz
•
11th Grade
20 questions
SSS/SAS
Quiz
•
9th - 12th Grade
16 questions
ACT English - Grammar Practice #2
Quiz
•
11th Grade
12 questions
Unit 8: The Early Cold War
Quiz
•
11th Grade