# Tag Archives: GATE-GATE-CS-2006

Consider these two functions and two statements S1 and S2 about them int work1(int *a, int i, int j) {     int x = a[i+2];     a[j]… Read More
Given two arrays of numbers a1, a2, a3,…an and b1, b2, .. bn where each number is 0 or 1, the fastest algorithm to find… Read More
Consider the following C-function in which a[n] and b[m] are two sorted integer arrays and c[n + m] be another integer array. void xyz(int a[],… Read More
Suppose we have a O(n) time algorithm that finds median of an unsorted array. Now consider a QuickSort implementation where we first find median using… Read More
Consider the following recurrence: Which one of the following is true? (A) T(n) = (loglogn) (B) T(n) = (logn) (C) T(n) = (sqrt(n)) (D) T(n)… Read More
A set X can be represented by an array x[n] as follows: Consider the following algorithm in which x,y and z are Boolean arrays of… Read More
An implementation of a queue Q, using two stacks S1 and S2, is given below: void insert(Q, x) {    push (S1, x); }     void… Read More
Let T be a depth first search tree in an undirected graph G. Vertices u and n are leaves of this tree T. The degrees… Read More
Consider the following graph: Which one of the following cannot be the sequence of edges added, in that order, to a minimum spanning tree using… Read More
Station A needs to send a message consisting of 9 packets to Station B using a sliding window (window size 3) and go-back-n error control… Read More