Consider the data given in above question, the correction needed in the program to make it work properly is (A) Change line 6 to: if… Read More
Tag Archives: GATE-GATE CS 2008
Consider the following C program that attempts to locate an element x in an array Y[] using binary search. The program is erroneous. 1. f(int… Read More
Consider the data given in above question. Which of the following is a correct attribute set for one of the tables for the correct answer… Read More
Consider the following ER diagram. The minimum number of tables needed to represent M, N, P, R1, R2 is (A) 2 (B) 3 (C) 4… Read More
The subset-sum problem is defined as follows. Given a set of n positive integers, S = {a1 ,a2 ,a3 ,…,an} and positive integer W, is… Read More
The subset-sum problem is defined as follows. Given a set of n positive integers, S = {a1 ,a2 ,a3 ,…,an} and positive integer W, is… Read More
The value of X5 is (A) 5 (B) 7 (C) 8 (D) 16 Answer: (C) Explanation: Since, X(n) = X(n – 1) + X(n –… Read More
Let xn denote the number of binary strings of length n that contain noconsecutive 0s. Which of the following recurrences does Xn satisfy? (A) A… Read More
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:… Read More
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… Read More
Consider the program given in above question, f1(8) and f2(8) return the values (A) 1661 and 1640 (B) 59 and 59 (C) 1640 and 1640… Read More
Consider the following C program int f1(int n) { if(n == 0 || n == 1) return n; else return (2*f1(n-1) + 3*f1(n-2)); } … Read More
The cache hit ratio for this initialization loop is (A) 0% (B) 25% (C) 50% (D) 75% Answer: (C) Explanation: Explanation: Cache hit ratio=No. of… Read More
Consider the data given in above question. Which of the following array elements has the same cache index as ARR[0][0]? (A) ARR[0][4] (B) ARR[4][0] (C)… Read More
Consider a machine with a 2-way set associative data cache of size 64 Kbytes and block size 16 bytes. The cache is managed using 32… Read More