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
Which of the following statements about the Two Phase Locking () protocol is/are TRUE?
Which of the following statements about fragmentation is/are TRUE?
An instruction format has the following structure: Instruction Number: Opcode destination reg, source reg-, source reg- Consider the following sequence of instructions to be executed in a pipelined processor: Which of the …
Which of the following fields of an header is/are always modified by any router before it forwards the packet?
Which of the following statements is/are FALSE?
For a Boolean variable , which of the following statements is/are FALSE?
Consider the following function definition. int fX(char *a) { char *b = a; while (*b) b++; return b - a; } Which of the following statements is/are TRUE?
Let be the partial order defined on the set as follows The number of total orders on that contain is __________.
Let be an array containing integer values. The distance of is defined as the minimum number of elements in that must be replaced with another integer so that the resulting array is sorted in non-decreasing order. The distance of the array is ___________.
What is the output of the following program? #include <stdio.h> int main() { double a[2]={20.0,25.0},* p,* q; p=a ; q=p+1 ; printf("%d,%d", (int) (q-p),( int)(* q- * p)); return 0;}
Consider a single processor system with four processes and , represented as given below, where for each process the first value is its arrival time, and the second value is its burst time. , and . Which one of the following options …
Which one of the following prefixes exactly represents the range of addresses to ?
You are given a set of distinct integers. A binary search tree is created by inserting all elements of one by one, starting with an empty tree. The tree follows the convention that, at each node, all values stored in the left subtree of the node are smaller than the value stored at the node. You are not aware of the sequence in …
Let be the -state with -transitions shown in the diagram below. Which one of the following regular expressions represents the language accepted by ?
Consider an array that contains positive integers. A subarray of is defined to be a sequence of array locations with consecutive indices. The code snippet given below has been written to compute the length of the longest subarray of that contains at most two distinct integers. The …
Let and be random variables, not necessarily independent, that take real values in the interval . Let and let the mean values of be , respectively. Which one of the following statements is TRUE?
The relation schema, Person (pid, city), describes the city of residence for every person uniquely identified by pid. The following relational algebra operators are available: selection, projection, cross product, and rename. To find the list of cities where at least persons reside, using the above operators, the minimum number of cross product …
Consider a multi-threaded program with two threads and . The threads share two semaphores: (initialized to ) and (initialized to ). The threads also share a global variable (initialized to ). The threads execute the code shown below. //code of T 1 wait (s1); x = x+1; print (x); …
Let be an matrix over the set of all real numbers . Let be a matrix obtained from by swapping two rows. Which of the following statements is/are TRUE?
Let and be two stacks. has capacity of elements. has capacity of elements. already has elements: , and , whereas is empty, as shown below. …
