GATE 2005 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2005

203 questions

MCQ 2031-mark 203

Questions 111–115 of 203

Q111Asymptotic Notation1 markMCQ−0.33 if wrong
Consider the following C-function:
 double foo (int n)
{
    int i;
    double sum;
    if (n == 0) return 1.0;
    else
    {
        sum = 0.0;
        for (i = 0; i < n; i++)
            sum += foo (i);
        return sum;
    }
} 
The space complexity of the above function is:

Q112Asymptotic Notation1 markMCQ−0.33 if wrong
The time complexity of computing the transitive closure of a binary relation on a set of n elements is known to be:

Q113Recurrence Relation1 markMCQ−0.33 if wrong
Let T(n) be a function defined by the recurrence
T(n)=2T(n/2)+n for n≥2T(n) = 2T(n/2) + \sqrt n \text{ for }n \geq 2 and
T(1)=1T(1) = 1
Which of the following statements is TRUE?

Q114Recurrence Relation1 markMCQ−0.33 if wrong
Suppose T(n)=2T(n/2)+n,T (n) = 2T(n/2) + n, T(0)=T(1)=1
Which one of the following is FALSE?

Q115Greedy Technique1 markMCQ−0.33 if wrong
We are given 9 tasks T1, T2... T9. The execution of each task requires one unit of time. We can execute one task at a time. Each task Ti has a profit Pi and a deadline di Profit Pi is earned if the task is completed before the end of the dith unit of time.
Task Profit Deadline T1 15 7 T2 20 2 T3 30 5 T4 18 3 T5 18 4 T6 10 5 T7 23 2 T8 16 7 T9 25 3
What is the maximum profit earned?