Question 1

Time: 00:00:00
What is the time complexity of given algorithm ?

void function (int n)
{
int a = 0;
for (int i = 0; i <= n; i++)
for (int j = n / 2; j <= n; j++)
for (int k = 1; k <= n; k = k * 2)
a++;
}

O((N^2)* (log N))

O((N^2)* (log N))

O(N^3)

O(N^3)

O(N log N)

O(N log N)

Constant

Constant

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

Please login to submit your explanation

Question 2

Time: 00:00:00
Bubble sort is a sorting algorithm used to sort the elements of an array .Here is that array arr={7,9,17,16}. How many iterations does it require to sort the given array?

 

2

2

4

4

Zero

Zero

1

1

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

Please login to submit your explanation

Question 3

Time: 00:00:00
Which design technique is used to find all the pairs of shortest distance in a graph from the following algorithm?

 

Divide And Conquer

Divide And Conquer

Greedy Algorithm

Greedy Algorithm

Backtracking

Backtracking

Dynamic Programming

Dynamic Programming

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

Please login to submit your explanation

Question 4

Time: 00:00:00
Find the pivot element from the given input using median-of-three partitioning method.

8,7,9,3,6,2,4,1,0

6

6

9

9

4

4

1

1

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

Please login to submit your explanation

Question 5

Time: 00:00:00
To sort an array of 3 million elements . Which of the following algorithm is best suited?

Bubble sort

Bubble sort

Insertion sort

Insertion sort

Merge sort

Merge sort

Quick sort

Quick sort

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

Please login to submit your explanation

Question 6

Time: 00:00:00
What is the time complexity of the given algorithm ?

function (int n)
{
int i = 1;
while (i < n)
{
int j = n;
while (j > 0)
j = j / 2;
i = 2 * i;
}
}

O(n)

O(n)

O(log^2 n)

O(log^2 n)

O(n^2)

O(n^2)

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

Question 7

Time: 00:00:00
Is Quick Sort a stable algorithm ?

False

False

True

True

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

Please login to submit your explanation

Question 8

Time: 00:00:00
What is the run time complexity of heap sort algorithm?

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

Question 9

Time: 00:00:00
Recursion is similar to which of the following?

Goto statement

Goto statement

Loop

Loop

If-else

If-else

Switch Case

Switch Case

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

Please login to submit your explanation

Question 10

Time: 00:00:00
When elements of array are already in sorted array. Which of the following is the fastest sorting algorithm ?

Quick Sort

Quick Sort

Merge Sort

Merge Sort

Insertion Sort

Insertion Sort

Bubble Sort

Bubble Sort

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

Please login to submit your explanation

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

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Get over 200+ Courses under One Subscription

mute

Don’t settle Learn from the Best with PrepInsta Prime Subscription

Learn from Top 1%

One Subscription, For Everything

The new cool way of learning and upskilling -

Limitless Learning

One Subscription access everything

Job Assistance

Get Access to PrepInsta Prime

Top Faculty

from FAANG/IITs/TOP MNC's

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.