Divide et Impera

Quiz
•
Computers
•
11th Grade - University
•
Easy
+1
Standards-aligned

Marilena Vilciu
Used 5+ times
FREE Resource
12 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
void suma(int v[], int s, int d){
if( s>d) return ...?...;
else
return suma(v,s, (s+d)/2-1) + v[(s+d)/2]+
suma (v, (s+d)/2 +1, d);
}
Tags
suma
2.
FILL IN THE BLANK QUESTION
45 sec • 1 pt
void suma(int v[], int s, int d){
if( s>d) return 0;
else
return suma(v,s, ...?...) + v[(s+d)/2]+
suma (v, (s+d)/2 +1, d);
}
Tags
suma
3.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
void suma(int v[], int s, int d){
if( s>d) return 0;
else
return suma(v,s, (s+d)/2-1) ...?... v[(s+d)/2]...?...
suma (v, (s+d)/2 +1, d);
}
Tags
suma
4.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
int nr(int v[], int x, int s, int d){
if(...?...) return 0;
else {
int m; m=(s+d)/2;
if ( v[m]==x )
return
1 + nr(v,x,s, m-1) +nr(v, x, m+1,d);
else
nr(v,x,s, m-1) +nr(v, x, m+1,d);
}
}
Tags
numarare
5.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
int nr(int v[], int x, int s, int d){
if(s>d) return 0;
else {
int m; m=(s+d)/2;
if ( v[m]==x )
return ...?... + nr( v, x, s, m-1) +nr (v, x, m+1,d);
else
return nr (v, x, s, m-1) +nr (v, x, m+1,d);
}
}
Tags
numarare
6.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
int nr(int v[], int x, int s, int d){
if(s>d) return 0;
else {
int m; m=(s+d)/2;
if ( v[m]==x )
return 1 + nr(v,x,s,...?...) +nrAp(v, x, m+1,d);
else
return nr(v,x,s,...?...) +nrAp(v, x, m+1,d);
}
}
Tags
numarare
7.
FILL IN THE BLANK QUESTION
1 min • 1 pt
int maxim(int v[], int s, int d){
if (s==d) return ...?...;
else if(s+1==d) if(v[s]>v[d]) return v[s];
else return v[d];
else {
int m1, m2;
m1=maxim(v,s,(s+d)/2);
m2=maxim(v,(s+d)/2+1,d);
if(m1>m2)return m1;
else return m2;
}
}
Tags
maxim
Create a free account and access millions of resources
Similar Resources on Wayground
14 questions
Java Operators

Quiz
•
University
12 questions
Operators in C

Quiz
•
University
15 questions
Structuri neomogene

Quiz
•
9th - 12th Grade
10 questions
Python - Functions

Quiz
•
University
16 questions
PSC ALM QUIZ

Quiz
•
University
10 questions
Operators in C

Quiz
•
9th - 12th Grade
15 questions
2D Arrays

Quiz
•
9th - 12th Grade
10 questions
Expression in C Programming

Quiz
•
University
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade