GATE 2015 (Session 1) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2015 (Session 1)

65 questions

MCQ 45 · NAT 201-mark 30 · 2-mark 35

Questions 61–65 of 65

Q61SQL2 marksNAT
Consider the following relations:
Student Performance Roll_No Student_Name 1Raj 2Rohit 3Raj Roll_No Course Marks 1Math80 1English70 2Math75 3English80 2Physics65 3Math80
Consider the following SQL query.
SELECT S.Student_Name, sum(P.Marks)
FROM Student S, Performance P
WHERE S.Roll_No = P.Roll_No
GROUP BY S.Student_Name

The number of rows that will be returned by the SQL query is _____________.

Q62Array and Pointer2 marksMCQ−0.67 if wrong
What is the output of the following C code? Assume that the address of x is 2000 (in decimal) and an integer requires four bytes of memory.
int main () {
unsigned int x[4][3] ={{1,2,3},{4,5,6},{7,8,9},{10,11,12}};
printf("%u, %u, %u", x+3, *(x+3), *(x+2)+3);
}

Q63Minimum Spanning Tree2 marksNAT
The graph shown below has 8 edges with distinct integer edge weights. The minimum spanning tree (MST) is of weight 36 and contains the edges: {(A, C), (B, C), (B, E), (E, F), (D, F)}. The edge weights of only those edges which are in the MST are given in the figure shown below. The minimum possible sum of weights of all 8 edges of this graph is ___________.
A B E F C D 15 4 2 9 6

Q64Asymptotic Notation2 marksMCQ−0.67 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?

Q65Loop2 marksMCQ−0.67 if wrong
Consider the following pseudo code, where x and y are positive integers.
 begin
   q := 0
    r := x 
    while r >= y  do
         begin
               r := r - y
              q := q + 1
        end
end 
The post condition that needs to be satisfied after the program terminates is