Time Left - 12:00 mins

Algorithm : Nuclear Quiz 2

Attempt now to get your rank among 159 students!

Question 1

Which of the following is true about insertion sort?

I. Insertion sort work better when array is almost sorted.

II. Insertion Sort will asymptotically work better when we use binary search instead of linear search.

III. Insertion sort best case if O(n2).

IV. Between insertion sort and Selection sort, Selection sort is preferred when swap is costly instead of insertion sort.

Question 2

Given below are 4 functions, labelled I, II, III and IV.

I. 999999n

II. 0.99999n logn

III. 1.000001n

IV. n2

The increasing order of the above functions in terms of their asymptotic complexity is

Question 3

Consider the following statements:

S1: = n2019 = O(n2020)

S2: = O(n2019) = O(n2020)

Which of the above statements is/are correct?

Question 4

In Quicksort, which of the following is true?

i) Ideal for sorted array

ii) Works best when input is not almost sorted.

iii) worst case is O(n2)

iv) Better than insertion sort for every type of input.

Question 5

Consider the following recurrence relation :

Which of the following best describes T(n) ?

Question 6

Consider following functions:

f(n) = (log n)n-1

g(n) = 2n

h(n) = en/n

Which of the following is true?

Question 7

Consider an array containing ‘n’ elements. The elements present in an array are in arithmetic progression, but one element is missing in that order. What is the time complexity to find the position of the missing element using divide and conquer?

Question 8

Given f(n) = θ(n), g(n) = Ω(n), h(n) = O(n). Then f(n) + [g(n) h(n)] = ?

Question 9

In the above algorithm, if input data items are already in sorted order then what is the Time complexity?

Question 10

Consider the following function:

What is the worst case running time of the function f for any positive value of n ?

  • 159 attempts
  • 2 upvotes
  • 0 comments
Jul 24GATE & PSU CS

Posted by:

Priya UpadhyayPriya UpadhyayMember since Sep 2020
Priya Upadhyay
Share this quiz   |