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 following languages. Which one of the following is TRUE?
Each of a set of processes executes the following code using two semaphores and initialized to and , respectively. Assume that is a shared variable initialized to and not used in CODE SECTION P. wait(a); count=count+1; if (count==n) …
Consider the productions and . Each of the five non-terminals and has two attributes: is a synthesized attribute, and is an inherited attribute. Consider the following rules. Rule and Rule and …
Consider the following five disk access requests of the form (request id, cylinder number) that are present in the disk scheduler queue at a given time. Assume the head is positioned at cylinder . The scheduler follows Shortest Seek Time First scheduling to service the requests. Which one of the following …
Consider a relational table that is in , but not in BCNF. Which one of the following statements is TRUE?
Which one of the following predicate formulae is NOT logically valid? Note that is a predicate formula without any free occurrence of .
Let be a directed, weighted graph with weight function . For some function , for each edge, define as . Which one of the options completes the following sentence so that it is TRUE? “The shortest paths in under are shortest …
An organization requires a range of IP address to assign one to each of its computers. The organization has approached an Internet Service Provider (ISP) for this task. The ISP uses CIDR and serves the requests from the available IP address space . The ISP wants to assign an address space to the organization which will minimize the …
In a balanced binary search tree with elements, what is the worst case time complexity of reporting all elements in range ? Assume that the number of reported elements is .
The number of permutations of the characters in LILAC so that no character appears in its original position, if the two L’s are indistinguishable, is ______.
Consider a non-pipelined processor operating at GHz. It takes clock cycles to complete an instruction. You are going to make a - stage pipeline out of this processor. Overheads associated with pipelining force you to operate the pipelined processor at GHz. In a given program, assume that are memory instructions, …
A processor has registers and uses -bit instruction format. It has two types of instructions: I-type and R-type. Each I-type instruction contains an opcode, a register name, and a -bit immediate value. Each R-type instruction contains an opcode and two register names. If there are distinct I-type opcodes, then the maximum number of …
For , let be a non-zero vector. Suppose that is chosen uniformly at random from . Then, the probability that is an odd number is______________
Consider the following C functions. int fun1(int n) { static int i= 0; if (n > 0) { ++i; fun1(n-1); } return (i); } int fun2(int n) { static int i= 0; if (n>0) { i = i+ fun1 (n) ; fun2(n-1) ; } return (i); } The return value of is _________
Consider the array representation of a binary min-heap containing elements. The minimum number of comparisons required to find the maximum in the heap is ___________.
Consider the following C functions. int tob (int b, int* arr) { int i; for (i = 0; b>0; i++) { if (b%2) arr [i] = 1; else arr[i] = 0; b = b/2; } return (i); } int pp(int a, int b) { int arr[20]; int i, tot = 1, ex, len; ex = a; len = tob(b, arr); for (i=0; i<len ; i++) { if (arr[i] ==1) tot = tot * ex; ex= ex*ex; } return (tot) ; } The value returned …
Consider a graph , where , , and weight of the edge is . The weight of minimum spanning tree of is _________
Consider the following set of processes, assumed to have arrived at time . Consider the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For RR, assume that the processes are scheduled in the order. …
Consider the following language. number of ’s in divisible by but not divisible by The minimum number of states in DFA that accepts is _________
Consider a paging system that uses -level page table residing in main memory and a for address translation. Each main memory access takes ns and lookup takes ns. Each page transfer to/from the disk takes ns. Assume that the hit ratio is , page fault rate is . …
