Mathematical Analysis of Non recursive Algorithms

Mathematical Analysis of Non recursive Algorithms

Professional Development

5 Qs

quiz-placeholder

Similar activities

Python_DS2

Python_DS2

Professional Development

10 Qs

Graph

Graph

Professional Development

8 Qs

C programming

C programming

Professional Development

10 Qs

Guess the Word

Guess the Word

Professional Development

10 Qs

SOAL PRETEST PPG 8

SOAL PRETEST PPG 8

Professional Development

10 Qs

CONOCIMIENTO DS 058 2003 MTC

CONOCIMIENTO DS 058 2003 MTC

Professional Development

10 Qs

Prova de ATI/ATF

Prova de ATI/ATF

Professional Development

10 Qs

DC QuizZ 3

DC QuizZ 3

Professional Development

10 Qs

Mathematical Analysis of Non recursive Algorithms

Mathematical Analysis of Non recursive Algorithms

Assessment

Quiz

Professional Development

Professional Development

Easy

Created by

Niranjani Vijayan

Used 9+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Examples of O(1) algorithms are______________.

A. Multiplying two numbers.

B. assigning some value to a variable

C. displaying some integer on console

D. All of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Examples of O(n2) algorithms are______________.

A. Adding of two Matrices

B. Initializing all elements of matrix by zero

C. Both A and B

D. Neither A nor B

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The complexity of three algorithms is given as: O(n), O(n2) and O(n3). Which should execute slowest for large value of n?

A. O(n)

B. O(n2)

C. O(n3)

D. All will execute in same time.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Express the formula (n-1)*(n-5) in terms of big Oh notation

O(1)

O(log n)

O(n)

O(n2)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

EXAMPLE 1 Consider the problem of finding the value of the largest element in a list of n numbers. For simplicity, we assume that the list is implemented as an array. The following is pseudocode of a standard algorithm for solving the problem.

ALGORITHM MaxElement(A[0..n 1])

//Determines the value of the largest element in a given array

//Input: An array A[0..n − 1] of real numbers

//Output: The value of the largest element in A maxval A[0]

for i 1 to n 1 do

if A[i] > maxval maxval A[i]

return maxval

Is the algorithm correct for the above question?

yes

no