Following questions have been asked in GATE 2009 CS exam. 1) Consider two transactions T1 and T2, and four schedules S1, S2, S3, S4 of… Read More »

Following Questions have been asked in GATE CS 2010 exam. 1) A relational schema for a train reservation database is given below. Passenger (pid, pname,… Read More »

Following Questions have been asked in GATE 2011 exam. 1. Consider a relational table with a single record for each registered student with the following… Read More »

Following Questions have been asked in GATE 2012 exam. 1) Consider the following transactions with data items P and Q initialized to zero: T1: read… Read More »

Following questions have been asked in GATE CS 2006 exam. 1) Consider three processes (process id 0, 1, 2 respectively) with compute time bursts 2,… Read More »

Following questions have been asked in GATE CS 2007 exam. 1) A virtual memory system uses First In First Out (FIFO) page replacement policy and… Read More »

Given a Binary Tree, convert it to a Binary Search Tree. The conversion must be done in such a way that keeps the original structure… Read More »

Following questions have been asked in GATE 2008 CS exam. 1) A process executes the following code for (i = 0; i < n; i++)… Read More »

In the previous post, we discussed how a Doubly Linked can be created using only one space for address field with every node. In this… Read More »

Given an array of n integers, find the 3 elements such that a[i] < a[j] < a[k] and i < j < k in 0(n)… Read More »

Given an array arr[0 … n-1] containing n positive integers, a subsequence of arr[] is called Bitonic if it is first increasing, then decreasing. Write… Read More »

Predict the output of following C++ program. filter_none edit close play_arrow link brightness_4 code #include <iostream> using namespace std; class Complex { private:… Read More »

In a party of N people, only one person is known to everyone. Such a person may be present in the party, if yes, (s)he… Read More »

In computer science and mathematics, the Josephus Problem (or Josephus permutation) is a theoretical problem. Following is the problem statement: There are n people standing… Read More »

Given an unsorted array that contains even number of occurrences for all numbers except two numbers. Find the two numbers which have odd occurrences in… Read More »

You are given an unsorted array with both positive and negative elements. You have to find the smallest positive number missing from the array in… Read More »

Given a rod of length n inches and an array of prices that contains prices of all pieces of size smaller than n. Determine the… Read More »

Given a sequence, find the length of the longest palindromic subsequence in it. As another example, if the given sequence is “BBABCBCAB”, then the output… Read More »

Hamiltonian Path in an undirected graph is a path that visits each vertex exactly once. A Hamiltonian cycle (or Hamiltonian circuit) is a Hamiltonian Path… Read More »

Given an undirected graph and a number m, determine if the graph can be coloured with at most m colours such that no two adjacent… Read More »