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 diagram The minimum number of tables needed to represent , , , , is Which of the following is a correct attribute set for one of the tables for the minimum number of tables needed to represent , , , , ?
Consider the following C program that attempts to locate an element in an array using binary search. The program is erroneous. f (int Y[10] , int x) { int i, j, k; i= 0; j = 9; do { k = (i + j) / 2; if( Y[k] < x) i = k;else j = k; } while (Y[k] != x) && (i < j)) ; if(Y[k] == x) printf(" x is in the array ") ; else printf(" x is …
Consider a machine with a -way set associative data cache of size Kbytes and block size bytes. The cache is managed using bit virtual addresses and the page size is Kbytes. A program to be run on this machine begins as follows: double ARR[1024][1024]; int i, j; /*Initialize array ARR to 0.0 */ for(i = 0; i < 1024; i++) …
Consider a machine with a -way set associative data cache of size Kbytes and block size bytes. The cache is managed using bit virtual addresses and the page size is Kbytes. A program to be run on this machine begins as follows: double ARR[1024][1024]; int i, j; /*Initialize array ARR to 0.0 */ for(i = 0; i < 1024; i++) …
Consider the following C functions: int f1 (int n) { if(n == 0 || n == 1) return n; else return (2 * f1(n-1) + 3 * f1(n-2)); } int f2(int n) { int i; int X[N], Y[N], Z[N]; X[0] = Y[0] = Z[0] = 0; X[1] = 1; Y[1] = 2; Z[1] = 3; for(i = 2; i <= n; i++){ X[i] = Y[i-1] + Z[i-2]; Y[i] = 2 * X[i]; Z[i] = 3 * X[i]; } return X[n]; } and return …
Delayed branching can help in the handling of control hazards The following code is to run on a pipelined processor with one branch delay slot: I1: ADD I2: Sub I3: ADD I4: STORE Memory BRANCH to Label if Which of the instructions I1, I2, I3 or I4 …
Let denote the number of binary strings of length that contain no consecutive s. The value of is
The subset-sum problem is defined as follows. Given a set of positive integers, , and positive integer , is there a subset of whose elements sum to ? A dynamic program for solving this problem uses a Boolean array, , with rows and columns. …
The subset-sum problem is defined as follows. Given a set of positive integers, , and positive integer , is there a subset of whose elements sum to ? A dynamic program for solving this problem uses a Boolean array, , with rows and columns. …
is a graph on vertices and edges. The edges of can be partitioned into two edge-disjoint spanning trees. Which of the following is NOT true for ?
Let denote the number of binary strings of length that contain no consecutive s. Which of the following recurrences does satisfy?
Delayed branching can help in the handling of control hazards For all delayed conditional branch instructions, irrespective of whether the condition evaluates to true or false,
Consider the following C functions: int f1 (int n) { if(n == 0 || n == 1) return n; else return (2 * f1(n-1) + 3 * f1(n-2)); } int f2(int n) { int i; int X[N], Y[N], Z[N]; X[0] = Y[0] = Z[0] = 0; X[1] = 1; Y[1] = 2; Z[1] = 3; for(i = 2; i <= n; i++){ X[i] = Y[i-1] + Z[i-2]; Y[i] = 2 * X[i]; Z[i] = 3 * X[i]; } return X[n]; } The running time of …
Consider a machine with a -way set associative data cache of size and block size . The cache is managed using virtual addresses and the page size is . A program to be run on this machine begins as follows: double ARR[1024][1024]; int i, j; /*Initialize array ARR to 0.0 */ for(i = …
Consider the following relational schemes for a library database: Book (Title, Author, Catalog_no, Publisher, Year, Price) Collection(Title, Author, Catalog_no) with the following functional dependencies: …
Let R and S be two relations with the following schema where is the key for both schemas. Which of the following queries are equivalent? …
A processor uses bit physical address and bit virtual addresses, with a page frame size of Kbytes. Each page table entry is of size bytes. A three level page table is used for virtual to physical address translation, where the virtual address is used as follows: Bits are used to index into the first level page table. Bits …
A process executes the following code for(i=0; i<n; i++) fork(); The total number of child processes created is
Which of the following is NOT true of deadlock prevention and deadlock avoidance schemes?
Which of the following statements about synchronous and asynchronous I/O is NOT true?
