Algorithm Analysis questions

Q20

GATE CS 2015 CS-3Algorithm AnalysisMCQ1 mark−1/3 if wrong
Consider the equality ∑i=0ni3=X\sum_{i=0}^{n} i^3 = X and the following choices for XX

I.Θ(n4)II.Θ(n5)III.O(n5)IV.Ω(n3)\begin{array}{rl} \text{I.} & \Theta(n^4) \\ \text{II.} & \Theta(n^5) \\ \text{III.} & O(n^5) \\ \text{IV.} & \Omega(n^3) \end{array}

The equality above remains correct if XX is replaced by
Show answer without attempting

Answer: C

Q37

GATE CS 2015 CS-3Algorithm AnalysisMCQ2 marks−2/3 if wrong
Assume that a mergesort algorithm in the worst case takes 30 seconds for an input of size 64. Which of the following most closely approximates the maximum input size of a problem that can be solved in 6 minutes?
Show answer without attempting

Answer: B

Q64

GATE CS 2015 CS-3Algorithm AnalysisMCQ2 marks−2/3 if wrong
Let f(n)=nf(n) = n and g(n)=n(1+sin⁡n)g(n) = n^{(1+\sin n)}, where nn is a positive integer. Which of the following statements is/are correct?

I.f(n)=O(g(n))II.f(n)=Ω(g(n))\begin{array}{rl} \text{I.} & f(n) = O(g(n)) \\ \text{II.} & f(n) = \Omega(g(n)) \end{array}
Show answer without attempting

Answer: D

Q14

GATE CS 2015 CS-1Algorithm AnalysisMCQ1 mark−1/3 if wrong
Which one of the following is the recurrence equation for the worst case time complexity of the Quicksort algorithm for sorting nn (≥2\geq 2) numbers? In the recurrence equations given in the options below, cc is a constant.
Show answer without attempting

Answer: B

Q60

GATE CS 2015 CS-1Algorithm AnalysisMCQ2 marks−2/3 if wrong
An algorithm performs (log⁡N)1/2(\log N)^{1/2} find operations, NN insert operations, (log⁡N)1/2(\log N)^{1/2} delete operations, and (log⁡N)1/2(\log N)^{1/2} decrease-key operations on a set of data items with keys drawn from a linearly ordered set. For a delete operation, a pointer is provided to the record that must be deleted. For the decrease-key operation, a pointer is provided to the record that has its key decreased. Which one of the following data structures is the most suited for the algorithm to use, if the goal is to achieve the best total asymptotic complexity considering all the operations?
Show answer without attempting

Answer: A

Q64

GATE CS 2015 CS-1Algorithm AnalysisMCQ2 marks−2/3 if wrong
Consider the following C function.
int fun1(int n) {
    int i, j, k, p, q = 0;
    for (i = 1; i < n; ++i) {
        p = 0;
        for (j = n; j > 1; j = j/2)
            ++p;
        for (k = 1; k < p; k = k*2)
            ++q;
    }
    return q;
}
Which one of the following most closely approximates the return value of the function fun1?
Show answer without attempting

Answer: D

Q16

GATE CS 2015 CS-2Algorithm AnalysisMCQ1 mark−1/3 if wrong
An unordered list contains nn distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum is
Show answer without attempting

Answer: D

0/70 correct0 marks

Related topics in Algorithms