GATE 2019 CSE & IT
57 questions across 1 session
There are n unsorted arrays : A 1 , A 2 , …, A n . Assume that n is odd. Each of A 1 , A 2 , …, A n contains n distinct elements. There are no common elements between any two array...
The value of 3 51 mod 5 is_________.
In 16-bit 2's complement representation, the decimal number -28 is :
Consider the following C program : #include < stdio.h > int main () { int arr [] = {1,2,3,4,5,6,7,8,9,0,1,2,5}, *ip = arr+4; printf ("%d\n", ip[1]); return 0; } The number that wil...
Consider the following C program: #include < stdio.h > int main() { int a[] = {2, 4, 6, 8, 10} ; int i, sum = 0, *b = a + 4 ; for (i = 0; i < 5; i++) sum = sum + (*b - i) - *(b - i...
Let T be a full binary tree with 8 leaves. (A full binary tree has every level full). Suppose two leaves a and b of T are chosen uniformly and independently at random. The expected...
Which of the following protocol pairs can be used to send and retrieve e-mails (in that order)?
In a college, there are three student clubs. Sixty students are only in the Drama club, 80 students are only in the Dance club, 30 students are only in the Maths club, 40 students...
Consider that 15 machines need to be connected in a LAN using 8-port Ethernet switches. Assume that these switches do not have any separate uplink ports. The minimum number of swit...
Compute $$\mathop {\lim }\limits_{x \to 3} {{{x^4} - 81} \over {2{x^2} - 5x - 3}}$$
Ten friends planned to share equally the cost of buying a gift for their teacher. When two of them decided not to contribute, each of the other friends had to pay Rs 150 more. The...
Which one of the following kinds of derivation is used by LR parsers?
Consider the first order predicate formula φ: ∀x[(∀z z|x ⇒ ((z = x) ∨ (z = 1))) ⇒ ∃w (w > x) ∧ (∀z z|w ⇒ ((w = z) ∨ (z = 1)))] Here 'a|b' denotes that 'a divides b', where a and b...
Let G be an undirected complete graph on n vertices, where n > 2. Then, the number of different Hamiltonian cycles in G is equal to
The following C program is executed on a Unix/Linux system: #include < unistd.h > int main () { int i ; for (i=0; i<10; i++) if (i%2 == 0) fork ( ) ; return 0 ; } The total number...
Let the set of functional dependencies F = {QR → S, R → P, S → Q} hold on a relation schema X = (PQRS). X is not in BCNF. Suppose X is decomposed into two schemas Y and Z, where Y...
A certain processor uses a fully associative cache of size 16 kB. The cache block size is 16 bytes. Assume that the main memory is byte addressable and uses a 32-bit address. How m...
Which one of the following statements is NOT correct about the B + tree data structure used for creating an index of a relational database table?
"A recent High Court judgement has sought to dispel the idea of begging as a disease — which leads to its stigmatization and criminalization — and to regard it as a symptom. The un...
Consider a sequence of 14 elements : A = [-5, -10, 6, 3, -1, -2, 13, 4, -9, -1, 4, 12, -3, 0]. The subsequence sum $$S\left( {i,j} \right) = \sum\limits_{k = 1}^j {A\left[ k \right...
Consider the following C function. void convert(int n){ if(n < 0) printf("%d",n); else { convert(n/2); printf("%d",n%2); } } Which one of the following will happen when the functio...
Consider the following statements : I. The smallest element in a max-heap is always at a leaf node II. The second largest element in a max-heap is always a child of the root node I...
Consider the following C program : #include<stdio.h> int r() { static int num=7; return num--; } int main() { for(r();r();r()) printf("%od ",r()); return 0; } Which one of the foll...
Consider three machines M, N, and P with IP addresses 100.10.5.2, 100.10.5.5, and 100.10.5.6 respectively. The subnet mask is set to 255.255 .255 .252 for all the three machines. W...
An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random. The probability that the pivot element gets placed in...
Suppose that in an IP-over-Ethernet network, a machine X wishes to find the MAC address of another machine Y in its subnet. Which one of the following techniques can be used for th...
Consider the following grammar and the semantic actions to support the inherited type declaration attributes. Let $X_1, X_2, X_3, X_4, X_5$, and $X_6$ be the placeholders for the n...
Let G be any connected, weighted, undirected graph. I. G has a unique minimum spanning tree, if no two edges of G have the same weight. II. G has a unique minimum spanning tree, if...
A certain processor deploys a single-level cache. The cache block size is 8 words and the word size is 4 bytes. The memory system uses a $60-\mathrm{MHz}$ clock. To service a cache...
Consider the following snapshot of a system running $n$ concurrent processes. Process $i$ is holding $X_i$ instances of a resource $\mathrm{R}, 1 \leq i \leq n$. Assume that all in...
The index node (inode) of a Unix-like file system has 12 direct, one single-indirect and one double-indirect pointers. The disk block size is 4 kB , and the disk block address is 3...
Consider the following matrix : $$ R=\left[\begin{array}{cccc} 1 & 2 & 4 & 8 \\ 1 & 3 & 9 & 27 \\ 1 & 4 & 16 & 64 \\ 1 & 5 & 25 & 125 \end{array}\right] $$ The absolute value of th...
Consider the following C program : #include <stdio.h> int main(){ float sum = 0.0, j = 1.0, i = 2.0; while (i/j > 0.0625){ j = j + j; sum = sum + i/j; printf("%f\n", sum); } return...
Let U = {1, 2 ,..., n}. Let A = {(x, X) | x ∈ X, X ⊆ U}. Consider the following two statements on |A|. I. |A| = n2 n–1 II. |A| = $$\sum\limits_{k = 1}^n {k\left( {\matrix{ n \cr k...
Which one of the following is NOT a valid identity?
Consider the following two statements about database transaction schedules: I. Strict two-phase locking protocol generates conflict serializable schedules that are also recoverable...
Consider the augmented grammar given below : S' → S S → 〈L〉 | id L → L,S | S Let I 0 = CLOSURE ({[S' → ●S]}). The number of items in the set GOTO (I 0 , 〈 ) is: _____.
Consider Z = X - Y, where X, Y and Z are all in sign-magnitude form. X and Y are each represented in n bits. To avoid overflow, the representation of Z would require a minimum of :
The search engine's business model _____ around the fulcrum of trust.
Suppose Y is distributed uniformly in the open interval (1,6). The probability that the polynomial 3x 2 + 6xY + 3Y + 6 has only real roots is (rounded off to 1 decimal place) _____...
Three of the five students allocated to a hostel put in special requests to the warden. Given the floor plan of the vacant rooms, select the allocation plan that will accommodate a...
Two cars start at the same time from the same location and go in the same direction. The speed of the first car is 50 Km/h and the speed of the second car is 60 Km/h. The number of...
A court is to a judge as _______ is to a teacher.
Let G be an arbitrary group. Consider the following relations on G : R 1 : ∀a,b ∈ G, aR 1 b if and only if ∃g ∈ G such that a = g -1 bg R 2 : ∀a,b ∈ G, aR 2 b if and only if a = b...
The expenditure on the project _____ as follows; equipment Rs.20 lakhs, salaries Rs.12 lakhs, and contingency Rs.3 lakhs.
In an RSA cryptosystem, the value of the public modulus parameter n is 3007. If it is also known that $$\varphi $$(n) = 2880, where $$\varphi $$() denotes Euler's Totient Function,...
What is the minimum number of 2-input NOR gates required to implement a 4-variable function function expressed in sum-of-minterms form as f = Σ(0, 2, 5, 7, 8, 10, 13, 15)? Assume t...
The police arrested four criminals - P, Q, R and S. The criminals knew each other. They made the following statements: P says "Q committed the crime." Q says "S committed the crime...
Two numbers are chosen independently and uniformly at random from the set {1, 2, ...., 13}. The probability (rounded off to 3 decimal places) that their 4-bit (unsigned) binary rep...
Let X be a square matrix. Consider the following two statements on X. I. X is invertible. II. Determinant of X is non-zero. Which one of the following is TRUE?
Assume that in a certain computer, the virtual addresses are 64 bits long and the physical addresses are 48 bits long. The memory is word addressable. The page size is 8 kB and the...
Consider the following C program: #include < stdio.h > int jumble (int x, int y) { x = 2 * x + y ; return x ; } int main ( ) { int x=2, y=5 ; y = jumble (y, x) ; x = jumble (y, x)...
For Σ = {a, b}, let us consider the regular language L = {x | x = a 2+3k or x = b 10+12k , k ≥ 0}. Which one of the following can be a pumping length (the constant guaranteed by th...
Which one of the following languages over $\Sigma=\{a, b\}$ is NOT context-free?
Consider the following sets : S1. Set of all recursively enumerable languages over the alphabet $\{0,1\}$ S2. Set of all syntactically valid C programs S3. Set of all languages ove...
Let $\Sigma$ be the set of all bijections from $\{1, \ldots, 5\}$ to $\{1, \ldots, 5\}$, where id denotes the identity function, i.e. $\operatorname{id}(j)=j, \forall j$. Let $\cir...
If L is a regular language over Σ = {a, b}, which one of the following languages is NOT regular?