Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ALGO MODULE 2 FA2

Total questions: 82

Worksheet time: 43mins

Name
Class
Date
1.

A process in which a function calls itself directly or indirectly


(a)  

2.


A process which breaks a task into smaller subtasks

(a)  

3.

A powerful technique that can be used in place of iterations.

(a)  

4.

repeatedly execute the set of instructions

a)

Iteration

b)

Recursion

c)

Both

5.

when a statement in a function calls itself repeatedly.

a)

Iteration

b)

Recursion

c)

Both

6.

when a loop repeatedly executes until the controlling condition becomes false

a)

Iteration

b)

Recursion

c)

Both

7.

uses repetition structure

a)

Iteration

b)

Recursion

c)

Both

8.

does not use the stack so it's faster

a)

Iteration

b)

Recursion

c)

Both

9.

consumes less memory.

a)

Iteration

b)

Recursion

c)

Both

10.

makes the code longer.

a)

Iteration

b)

Recursion

c)

Both

11.

uses selection structure.

a)

Iteration

b)

Recursion

c)

Both

12.

usually slower due to the overhead of maintaining the stack.

a)

Iteration

b)

Recursion

c)

Both

13.

uses more memory

a)

Iteration

b)

Recursion

c)

Both

14.

It calls the same function again

a)

Direct recursion

b)

Indirect recursion

c)

Tail recursion

d)

Non-tail recursion

15.

a function calls another function, which in turn calls the first function again.

a)

Direct recursion

b)

Indirect recursion

c)

Tail recursion

d)

Non-tail recursion

16.

if the recursive call is the last thing done by the function. There is no need to keep record of the previous state.

a)

Direct recursion

b)

Indirect recursion

c)

Tail recursion

d)

Non-tail recursion

17.

if the recursive call is not the last thing done by the function. After returning back, there is some something left to evaluate

a)

Direct recursion

b)

Indirect recursion

c)

Tail recursion

d)

Non-tail recursion

18.


There is a systematic approach that has to be applied for analyzing any given algorithm. This systematic approach is modelled by a framework called as

a)

Analysis framework

b)

space

c)

efficiency of an algorithm

19.

the process of investigation of an algorithm’s efficiency respect to two resources.

a)

Analysis of algorithm

b)

space

c)

efficiency of an algorithm

20.

framework for predicting performance and comparing algorithms

a)

Analysis of algorithm

b)

scientific method

c)

efficiency of an algorithm

21.

describes the limiting behavior of a function when the argument tends towards a particular value or infinity, usually in terms of simpler functions

a)

Analysis of algorithm

b)

scientific method

c)

efficiency of an algorithm

d)

big O notation

e)

time complexity

22.


quantifies the amount of time taken by an algorithm to run as a function of the size of the input to the problem.

a)

Analysis of algorithm

b)

scientific method

c)

efficiency of an algorithm

d)

big O notation

e)

time complexity

23.

indicates how fast an algorithm runs

a)

Time efficiency or time complexity

b)

Space Efficiency or space complexity

24.

amount of memory units required by the algorithm including the memory needed for the i/p & o/p.

a)

Time efficiency or time complexity

b)

Space Efficiency or space complexity

25.

must be reproducible

a)

experiments

b)

hypothesis

26.

must be falsifiable

a)

experiments

b)

hypothesis

27.

which scientific method is this: _______ some features of the natural world

a)

Observe

b)

Hypothesize

c)

Predict

d)

Verify

e)

Validate

28.

which scientific method is this: _______ a model that is consistent with the observations

a)

Observe

b)

Hypothesize

c)

Predict

d)

Verify

e)

Validate

29.

which scientific method is this: _______ events using the hypothesis

a)

Observe

b)

Hypothesize

c)

Predict

d)

Verify

e)

Validate

30.

which scientific method is this: _______ the predictions by making further observations

a)

Observe

b)

Hypothesize

c)

Predict

d)

Verify

e)

Validate

31.

which scientific method is this: _______ by repeating until the hypothesis and observation agree

a)

Observe

b)

Hypothesize

c)

Predict

d)

Verify

e)

Validate

32.

cpu, memory, cache

a)

hardware

b)

software

c)

system

33.

compiler, interpreter, garbage collector

a)

hardware

b)

software

c)

system

34.

OS, network, other apps

a)

hardware

b)

software

c)

system

35.

The amount of memory required by an algorithm (including the input values to the algorithm) to run.

a)

Space complexity

b)

Time complexity

c)

Total running time

36.

sum of cost x frequency for all operations

a)

Space complexity

b)

Time complexity

c)

Total running time

37.


how much memory, in the worst case, is needed at any point in the algorithm.

a)

Space complexity

b)

Time complexity

c)

Total running time

38.

the extra space or the temporary space used by the algorithm during
it's execution.

a)

Space complexity

b)

Time complexity

c)

Total running time

d)

Auxiliary space

39.

Auxiliary Space + Input space = ?

a)

Space complexity

b)

Time complexity

c)

Total running time

d)

Auxiliary space

40.

The amount of time required by an algorithm to run for completion.

a)

Space complexity

b)

Time complexity

c)

Total running time

d)

Auxiliary space

e)

Frequency count

41.

a count denoting number of times of execution of a statement.


a)

Space complexity

b)

Time complexity

c)

Total running time

d)

Auxiliary space

e)

Frequency count

42.

the amount of memory used to save the compiled version of instructions

a)

Instruction space

b)

Environmental stack

c)

Data space

d)

Space complexity

43.

amount of space used by the variable and constants

a)

Instruction space

b)

Environmental stack

c)

Data space

d)

Space complexity

44.

while calculating the Space Complexity of any algorithm, we usually consider only ________ and we neglect the Instruction Space and Environmental Stack

a)

Instruction space

b)

Environmental stack

c)

Data space

d)

Space complexity

45.

bool, char, unsigned char, signed char, ___int8

a)

1 byte

b)

2 bytes

c)

4 bytes

d)

8 bytes

46.

___int16, short, unsigned short, wchar_t, __wchar_t

a)

1 byte

b)

2 bytes

c)

4 bytes

d)

8 bytes

47.

What is the basic operation when solving for graph problems

a)

division

b)

visiting a vertex

c)

multiplication of two numbers

d)

key comparison

48.

float, ___int32, int, unsigned int, long, unsigned long

a)

1 byte

b)

2 bytes

c)

4 bytes

d)

8 bytes

49.

double, __int64, long double, long long

a)

1 byte

b)

2 bytes

c)

4 bytes

d)

8 bytes

50.

constant

a)

O(1)

b)

O (log n)

c)

O(n)

d)

O(n log n)

e)

O(n^2)

51.

logarithmic

a)

O(1)

b)

O (log n)

c)

O(n)

d)

O(n log n)

e)

O(n^2)

52.

linear

a)

O(1)

b)

O (log n)

c)

O(n)

d)

O(n log n)

e)

O(n^2)

53.

linearithmetic / quasilinear

a)

O(1)

b)

O (log n)

c)

O(n)

d)

O(n log n)

e)

O(n^2)

54.

quadratic

a)

O(1)

b)

O (log n)

c)

O(n)

d)

O(n log n)

e)

O(n^2)

55.

cubic

a)

O(n^3)

b)

O(n^k), k >= 1

c)

O(a^n), a >= 1

d)

O(n!)

56.

polynomial

a)

O(n^3)

b)

O(n^k), k >= 1

c)

O(a^n), a >= 1

d)

O(n!)

57.

exponential

a)

O(n^3)

b)

O(n^k), k >= 1

c)

O(a^n), a >= 1

d)

O(n!)

58.

factorial

a)

O(n^3)

b)

O(n^k), k >= 1

c)

O(a^n), a >= 1

d)

O(n!)

59.

log(n^2)

a)

constant

b)

logarithmic

c)

linear

d)

linearithmetic / quasilinear

e)

quadratic

60.

n, 2n + 5

a)

constant

b)

logarithmic

c)

linear

d)

linearithmetic / quasilinear

e)

quadratic

61.

n log n, log n!

a)

constant

b)

logarithmic

c)

linear

d)

linearithmetic / quasilinear

e)

quadratic

62.

n^2 + n, n^10

a)

polynomial

b)

exponential

c)

factorial

d)

linearithmetic / quasilinear

e)

quadratic

63.

1.1^n, 10^n

a)

polynomial

b)

exponential

c)

factorial

d)

linearithmetic / quasilinear

e)

quadratic

64.

how many nanoseconds will it take to: add an integer

a)

2.1

b)

2.4

c)

5.4

d)

4.6

e)

4.2

65.

how many nanoseconds will it take to: multiply an integer

a)

2.1

b)

2.4

c)

5.4

d)

4.6

e)

4.2

66.

how many nanoseconds will it take to: divide an integer

a)

2.1

b)

2.4

c)

5.4

d)

4.6

e)

4.2

67.

how many nanoseconds will it take to: add a floating point

a)

2.1

b)

2.4

c)

5.4

d)

4.6

e)

4.2

68.

how many nanoseconds will it take to: multiply a floating point

a)

2.1

b)

2.4

c)

5.4

d)

4.6

e)

4.2

69.

how many nanoseconds will it take to: divide a floating point

a)

13.5

b)

91.3

c)

129.0

d)

4.6

e)

4.2

70.

how many nanoseconds will it take to: sine

a)

13.5

b)

91.3

c)

129.0

d)

4.6

e)

4.2

71.

When the input size measures the matrix dimension or total number of elements what is the basic operation

a)

division

b)

multiplication of two numbers

c)

visiting a vertex

d)

key comparison

72.

how many nanoseconds will it take to: arctangent

a)

13.5

b)

91.3

c)

129.0

d)

4.6

e)

4.2

73.

Order of growth of an algorithm is a way of saying/predicting how execution
time of a program and the space/memory occupied by it changes with the
input size.

a)

true

b)

false

74.

class of functions f(n) that grow no faster than g(n)

a)

b)

c)

75.

class of function f(n) that grow at same rate as g(n)

a)

b)

c)

76.

class of function f(n) that grow at least as fast as g(n)

a)

b)

c)

77.

encloses the function from above and below. Since it represents the upper and the lower bound of the running time of an algorithm, it is used for analyzing the average case complexity of an algorithm.

a)

Big theta

b)

Big Oh

c)

Big Omega

78.

represents the upper bound of the running time of an algorithm. Thus, it gives the worst case complexity of an algorithm.

a)

Big theta

b)

Big Oh

c)

Big Omega

79.

represents the lower bound of the running time of an algorithm. Thus, it provides best case complexity of an algorithm.

a)

Big theta

b)

Big Oh

c)

Big Omega

80.


This algorithmic check for the efficiency looking at the max input of n

a)

best

b)

average

c)

worst

d)

none

81.

In a multi-user system _____ depends on many factors such as: System load, Number of other programs running, Instruction set used and Speed of underlying hardware

a)

Space complexity

b)


Executing time

c)

CPU count

d)

Time Complexity

82.


Finding the smallest or largest item in an unsorted array

a)

linear

b)

cubic

c)

quadratic

d)

constant