
Mathematical Analysis of Non recursive Algorithms

Quiz
•
Professional Development
•
Professional Development
•
Easy
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
Similar Resources on Wayground
10 questions
KHÁCH HÀNG DOANH NGHIỆP

Quiz
•
Professional Development
7 questions
Metodos numericos

Quiz
•
Professional Development
10 questions
Binary Search Tree

Quiz
•
Professional Development
10 questions
Revisando os Conceitos Básicos

Quiz
•
Professional Development
8 questions
Graph

Quiz
•
Professional Development
7 questions
Artificial Intelligence Basics

Quiz
•
Professional Development
10 questions
Guess the Word

Quiz
•
Professional Development
10 questions
Scientific Python

Quiz
•
KG - Professional Dev...
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade