Let S = {1, 2, 3, …., m}, m>3. Let x1, x2,….xn be the subsets of S each of size 3. Define a function f… Read More
Tag Archives: GATE-CS-2006
Given a set of elements N = {1, 2, …, n} and two arbitrary subsets A⊆N and B⊆N, how many of the n! permutations π… Read More
F is an n*n real matrix. b is an n*1 real vector. Suppose there are two n*1 vectors, u and v such that, u ≠… Read More
Let E, F and G be finite sets. Let X = (E ∩ F) – (F ∩ G) and Y = (E – (E ∩… Read More
For each element in a set of size 2n, an unbiased coin is tossed. The 2n coin tosses are independent. An element is chosen if… Read More
Consider the following log sequence of two transactions on a bank account, with initial balance 12000, that transfer 2000 to a mortgage payment and then… Read More
(A) L1 only (B) L3 Only (C) L1 and L2 (D) L2 and L3 Answer: (D) Explanation: A PDA can be built only for L1.… Read More
We are given a set X = {x1, …. xn} where xi = 2i. A sample S ⊆ X is drawn by selecting each xi… Read More
An element in an array X is called a leader if it is greater than all elements to the right of it in X. The… Read More
Let S be an NP-complete problem and Q and R be two other problems not known to be in NP. Q is polynomial time reducible… Read More
Consider the following C-program fragment in which i, j and n are integer variables. for (i = n, j = 0; i >0; i /=… Read More
Which one of the following in place sorting algorithms needs the minimum number of swaps? (A) Quick sort (B) Insertion sort (C) Selection sort (D)… Read More
A scheme for storing binary trees in an array X is as follows. Indexing of X starts at 1 instead of 0. the root is… Read More
To implement Dijkstra’s shortest path algorithm on unweighted graphs so that it runs in linear time, the data structure to be used is: (A) Queue… Read More
Consider a weighted complete graph G on the vertex set {v1, v2, ..vn} such that the weight of the edge (vi, vj) is 2|i-j|. The… Read More