20 dec 2023 SRMIST TRP CPS    AN

20 dec 2023 SRMIST TRP CPS AN

Professional Development

15 Qs

quiz-placeholder

Similar activities

KTR-CTECH-AN -18.04.2024

KTR-CTECH-AN -18.04.2024

Professional Development

15 Qs

PROGRAMMING IN C

PROGRAMMING IN C

Professional Development

13 Qs

SASI -1st year -DAY1-AN(27.11.23)

SASI -1st year -DAY1-AN(27.11.23)

Professional Development

15 Qs

091223    SASI AN

091223 SASI AN

Professional Development

15 Qs

VCE-ALPHA-25.11.2023-AN

VCE-ALPHA-25.11.2023-AN

Professional Development

15 Qs

DSBS-FN-30.01.2024

DSBS-FN-30.01.2024

Professional Development

15 Qs

pointers B

pointers B

Professional Development

16 Qs

VRESEC-24.01.2024-AN-1-3

VRESEC-24.01.2024-AN-1-3

Professional Development

15 Qs

20 dec 2023 SRMIST TRP CPS    AN

20 dec 2023 SRMIST TRP CPS AN

Assessment

Quiz

English

Professional Development

Hard

Created by

CCC info@ccc.training

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Time complexity of the code? int fun(int n, int m, int o) { if (n <= 0) printf("%d, %d\n",m, o); else { fun(n-1, m+1, o); fun(n-1, m, o+1); }
Quadratic
O (log n)
O (n log m)
Exponential

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the time complexity of the following code? int fun(int x) { if (x <= 0) return 1; return 1 + fun(x-1); }
O(n)
O (log n)
O (n log n)
O (log log n)

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the time complexity of the code? int fun(int x) { if (x <= 0) return 1; return 1 + fun(x/5); }
O(n)
O (log n)
O (n log n)
O (log log n)

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

int sumDigits(int n) { if (n == 0) return 0; else return n % 10 + sumDigits(n / 10); } int main() { printf("Sum of Digits: %d\n", sumDigits(123)); return 0; }
6
5
9
12

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

void show(int,int,int); int main() { int a = 1; show(++a, a++, a); return 0; } void show(int i, int j, int k) { printf("%d %d %d,\n", i, j, k); }
1 1 3
3 1 3
3 1 1
3 3 3

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h> int factorial(const int n) { if (n <= 1) return 1; else return n * factorial(n - 1); } int main() { printf("Factorial: %d\n", factorial(5)); return 0; }
200
100
120
error

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

int mysteryFunction(int a, int b) { if (b == 0) return 1; else return a * mysteryFunction(a, b - 1); } int main() { printf("Mystery Function: %d\n", mysteryFunction(2, 3)); return 0; }
8
6
16
2

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?