Search Header Logo

Mathematical Analysis of Non recursive Algorithms

Authored by Niranjani Vijayan

Professional Development

Professional Development

Used 9+ times

Mathematical Analysis of Non recursive Algorithms
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Professional Development