GATE CS question library
Practise GATE CS Computer Science previous year questions free. Browse by subject, syllabus topic, year and question type, with answers and available solutions.
Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.
20 on this page
Consider the transition diagram of a PDA given below with input alphabet and stack alphabet . is the initial stack symbol. Let denote the language accepted by the PDA Which one of the following is TRUE?
Consider the weighted undirected graph with vertices, where the weight of edge is given by the entry in the matrix . W= The largest possible integer value of , for which at least one …
is an undirected simple graph in which each edge has a distinct weight, and is a particular edge of . Which of the following statements about the minimum spanning trees of is/are TRUE? If is the lightest edge of some cycle in , then every MST of includes . If is the heaviest edge of some …
What will be the output of the following program? void count (int n) { static int d=1; printf ("%d",n); printf ("%d",d); d++; if (n>1) count (n-1); printf ("%d",d); } void main(){ count (3); }
Let be a complete undirected graph on vertices, having edges with weights being and . The maximum possible weight that a minimum weight spanning tree of can have is __________
Consider the two cascade to multiplexers as shown in the figure . The minimal sum of products form of the output is
For a host machine that uses the token bucket algorithm for congestion control, the token bucket has a capacity of and the maximum output rate is per . Tokens arrive at a rate to sustain output at a rate of per . The token bucket is currently …
Let be a recursive language and be a recursively enumerable but not recursive language. Let and be two languages such that reduces to , and reduces to (reduction means the standard many-one reduction). Which one of the following statements is TRUE?
Consider the following proposed solution for the critical section problem. There are processes : . In the code, function returns an integer not smaller than any of its arguments .For all is initialized to zero. Code for ; do { c[i]=1; t[i]= pmax (t[0],....,t[n-1])+1; c[i]=0; for every j != i in …
A function , defined on the set of positive integers , satisfies the following properties: if is even if is odd Let be the set of distinct values that takes. The maximum possible size of is ___________.
Cylinder a disk queue with requests for to blocks on cylinders The C-LOOK scheduling algorithm is used. The head is initially at cylinder number , moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from to . The total head movement (in number of cylinders) …
Consider the recurrence relation . Let . The value of is __________.
An IP datagram of size arrives at a router. The router has to forward this packet on a link whose MTU (maximum transmission unit) is . Assume that the size of the IP header is The number of fragments that the IP datagram will be divided into for transmission is________.
Consider a computer system with ten physical page frames. The system is provided with an access sequence , where each is a distinct virtual page number. The difference in the number of page faults between the last-in-first-out page replacement policy and the optimal page replacement policy …
Consider the following experiment. Step 1. Flip a fair coin twice. Step 2. If the outcomes are (TAILS, HEADS) then output and stop. Step 3. If the outcomes are either (HEADS, HEADS) or (HEADS, TAILS), then output and stop. Step 4. If the outcomes are (TAILS, TAILS), then go to Step The probability that the output of the experiment is …
An operator delete for a binary heap data structure is to be designed to delete the item in the -th node. Assume that the heap is implemented in an array and refers to the -th index of the array. If the heap tree has depth (number of edges on the path from the root to the farthest leaf ), then what is the time complexity to …
Consider the following context-free grammars; Which one of the following pairs of languages is generated by and ,respectively?
The following function computes the maximum value contained in an integer array of size . int max (int *p,int n) { int a = 0, b=n-1; while (__________) { if (p[a]<= p[b]) {a = a+1;} else {b = b-1;} } return p[a]; } The missing loop condition is:
Consider the following two phase locking protocol. Suppose a transaction accesses (for read or write operations), a certain set of objects . This is done in the following manner: . acquires exclusive locks to in increasing order of their addresses. . The required …
What will be the output of the following pseudo-code when parameters are passed by reference and dynamic scoping is assumed? a = 3; void n(x) { x = x * a; print (x); } void m(y) { a = 1 ; a = y - a; n(a); print (a); } void main () { m(a); }
