1
GATE CSE 2001
Subjective
+5
-0
Consider a disk with the $$100$$ tracks numbered from $$0$$ to $$99$$ rotating at $$3000$$ $$rpm.$$ The number of sectors per track is $$100.$$ the time to move the head between two successive tracks is $$0.2$$ milliseconds.

(a) Consider a set of disk requests to read data from tracks $$32, 7, 45, 5$$ and $$10.$$ Assuming that the elevator algorithm is used to schedule disk requests, and the head is initially at track $$25$$ moving up (towards larger track numbers), what is the total seek time for servicing the requests?
(b) Consider an initial set of $$100$$ arbitrary disk requests and assume that no new disk requests arrive while servicing these requests. If the head is initially at track $$0$$ and the elevator algorithm is used to schedule disk requests, what is the worst case time to complete all the requests?

2
GATE CSE 2001
MCQ (Single Correct Answer)
+2
-0.6
What is printed by the print statements in the program P1 assuming call by reference parameter passing?
Program P1()
{
     x=10;
     y=3;
     func1(y,x,x);
     print x;
     print y;
}
func1(x,y,z)
{
     y=y+4;
     z=x+y+z;
}
A
10,3
B
31,3
C
27,7
D
None of the above
3
GATE CSE 2001
MCQ (Single Correct Answer)
+2
-0.6
Consider the following program
Program P2
      var n:int;
      procedure W(var x:int)
      begin
          x=x+1;
          print x;
      end

      procedure D
      begin
          var n:int;
          n=3;
          W(n);
      end
begin     \\begin P2
      n = 10;
      D;
end
If the language has dynamic scooping and parameters are passed by reference, what will be printed by the program?
A
10
B
11
C
3
D
None of the above
4
GATE CSE 2001
MCQ (Single Correct Answer)
+2
-0.6
Consider the following three C functions:
[P1] int*g(void)
     {
       int x=10;
       return(&x);
     }
[P2] int*g(void)
      {
        int *px;
       *px = 10;
        return px;
      }
[P3] int*g(void)
     {
       int *px
       px =(int*)malloc (size of (int));
       *px = 10;
       return px;
     }
Which of the above three functions are likely to cause problems with pointers?
A
Only P3
B
Only P1 and P3
C
Only P1 and P2
D
P1, P2 and P3
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
CBSE
Class 12