Question on Big O Notation Quiz-1

Question 1

Time: 00:00:00
What is the Big-O notation for the below algorithm given below?

l. N^2

ll.10*N^2+N

 

O(N) and O(log N^2)

O(N) and O(log N^2)

O(N^2) and O(N^2)

O(N^2) and O(N^2)

O(N) and O(N^2)

O(N) and O(N^2)

O(N^2) and O(N)

O(N^2) and O(N)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
What is the big-O complexity of the following code?

for{int i=n ;  i>0   ;   i--}

{

for{ int   j = i;   j  <  n;  j   *=  2}

{

for{ int  k = 0;  k  <  j;  k++}

{

.....

}

}

}

 

O(log n)

O(log n)

O(n ^ 2)

O(n ^ 2)

O(n ^ 3)

O(n ^ 3)

O(n)

O(n)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
What is the best suited Big O notation for merge sorting?

 

O(n)

O(n)

O(n^2)

O(n^2)

O(n log n)

O(n log n)

O(log n)

O(log n)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
The worst case time complexity of native version quicksort is_____.

O(n log n)

O(n log n)

O(2^n)

O(2^n)

O(n^2)

O(n^2)

O(n)

O(n)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
What is the big-o-notation to find the nth item in a list?

O(n)

O(n)

O(n!)

O(n!)

O(n^c)

O(n^c)

O(log n )

O(log n )

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
Consider the following :

for (int n = 0; n<100; n++)

{

for(int m = 0; m<=n; m++)

{

// search 4th element using binary search

}

}

What is the Big-O Complexity of the above code?

O(100*m*n*log N)

O(100*m*n*log N)

100*m*n*O(log N)

100*m*n*O(log N)

O(100 m log N)

O(100 m log N)

100m*O(log N)

100m*O(log N)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
Express the formula (n-1)*(n-5) in terms of big O notation

O(1)

O(1)

O(log n)

O(log n)

O(n)

O(n)

O(n^2)

O(n^2)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
The worst-case time complexity of Selection Exchange Sort is________.

O(n^2)

O(n^2)

O(log n)

O(log n)

O(n)

O(n)

O(n log n)

O(n log n)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
A list of n strings, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is

O (n log n)

O (n log n)

O (n^2 log n)

O (n^2 log n)

O (n^2 + log n)

O (n^2 + log n)

O (n^2)

O (n^2)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
The total number of comparisons made in quicksort for sorting a file of size n is

O(n log n)

O(n log n)

O(n2)

O(n2)

O(log n)

O(log n)

None of the above

None of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice! \n","Keep trying! \n","Not bad! \n","Good work! \n","Perfect! \n"]

Completed

0/0

Accuracy

0%

Get Prepinsta Prime

Get all 200+ courses offered by Prepinsta

Never Miss an OffCampus Update

Get OffCampus Updates on Social Media from PrepInsta

Follow us on our Media Handles, we post out OffCampus drives on our Instagram, Telegram, Discord, Whatsdapp etc.

Get Hiring Updates
Amazon,Google,Delottie & 30+companies are hiring ! Get hiring Updates right in your inbox from PrepInsta

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Get PrepInsta Prime Subscription

Get access to all the courses that PrepInsta offers, check the out below -

Companies

TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies

Programming

Data Structures, Top 500 Codes, C, C++, Java Python & other 10+ subjects

Skills

Full Stack Web Development, Data Science, Machine Learning, AWS Cloud, & other 10+ skills and 20+ projects

Comments