Divide et Impera

Divide et Impera

11th Grade - University

12 Qs

quiz-placeholder

Similar activities

Basics of C

Basics of C

University

10 Qs

DSA quiz 3 set 1

DSA quiz 3 set 1

University

10 Qs

Structuri neomogene

Structuri neomogene

9th - 12th Grade

15 Qs

Recursion

Recursion

University

8 Qs

C-Programming Basics

C-Programming Basics

12th Grade

16 Qs

Python - Functions

Python - Functions

University

10 Qs

Milking Minds 2 17-01-24

Milking Minds 2 17-01-24

University

15 Qs

C-Extended

C-Extended

University

16 Qs

Divide et Impera

Divide et Impera

Assessment

Quiz

Computers

11th Grade - University

Easy

suma, numarare, maxim

+1

Standards-aligned

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?