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 C code: #include<stdio.h> int *assignval (int *x, int val) { *x = val; return x; } void main () { int *x = malloc(sizeof(int)); if (NULL == x) return; x = assignval (x,0); if (x) { x = (int *)malloc(sizeof(int)); if (NULL == x) return; x = assignval (x,10); } printf("%d\n", *x); free(x); } The code suffers from which one of the …
Consider the following intermediate program in three address code p = a - b q = p * c p = u * v q = p + q Which one of the following corresponds to a static single assignment form of the above code?
Consider the struct defined below: struct data { int marks [100]; char grade; int cnumber; }; struct data student; The base address of student is available in register . The field student.grade can be accessed efficiently using:
Consider the following context-free grammar over the alphabet with as the start symbol:Which one of the following represents the language generated by the above grammar?
When two numbers and in 's complement representation (with and as the least significant bits) are added using a ripple-carry adder, the sum bits obtained are and the carry bits are . An overflow is said to have occurred if
The n-bit fixed-point representation of an unsigned real number uses bits for the fraction part. Let . The range of decimal values for in this representation is
Let be a binary search tree with nodes. The minimum and maximum possible heights of are: Note: The height of a tree with a single node is .
Let be scalars, not all zero, such that = 0 where are column vectors in . Consider the set of linear equations where and . The set of equations has
Consider a TCP client and a TCP server running on two different machines. After completing data transfer, the TCP client calls close to terminate the connection and a FIN segment is sent to the TCP server. Server-side TCP responds by sending an ACK, which is received by the client-side TCP. As per the TCP connection state diagram , in …
Consider the recurrence function Then in terms of notation is
Two transactions and are given as where denotes a operation by transaction on a variable and denotes a operation by transaction on a variable . The total number of conflict serializable …
If the characteristic polynomial of a matrix over (the set of real numbers) is , and one eigenvalue of is then the largest among the absolute values of the eigenvalues of is _______
Consider a machine with a byte addressable main memory of bytes divided into blocks of size bytes. Assume that a direct mapped cache having cache lines is used with this machine. The size of the tag field in bits is _______
Let be the language represented by regular expression . Let be the language generated by a context free grammar . Let be the language accepted by a Turing machine . Which of the following decision problems are undecidable? Given a regular expression and a string , is ? Given a context-free …
Consider the following languages. Which of the following are CORRECT? is context free but not regular is not context free is not context free but …
The read access times and the hit ratios for different caches in a memory hierarchy are as given below: …
is an undirected graph with vertices and edges such that each vertex of has degree at least . Then the maximum possible value of is _________ .
Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it: …
In a Tree , if the search-key value is bytes long , the block size is bytes and the pointer size is , then the maximum order of the Tree is ____
Consider the set of process with arrival time (in milliseonds), CPU burst time (in millisecods) and priority ( is the highest priority) shown below. None of the process have I/O burst time …
