Skip to content

Tag Archives: GATE-CS-2007

An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes: Process Execution… Read More
In a simplified computer the instructions are: The computer has only two registers, and OP is either ADD or SUB. Consider the following basic block:… Read More
Consider the following two statements: P: Every regular grammar is LL(1) Q: Every regular set has a LR(1) grammar Which of the following is TRUE?… Read More
Consider the grammar with non-terminals N = {S,C,S1 },terminals T={a,b,i,t,e}, with S as the start symbol, and the following set of rules: S --> iCtSS1|a… Read More
Consider the following C code segment: int IsPrime(n) {   int i,n;   for(i=2;i<=sqrt(n);i++)      if(n%i == 0)       {printf(“Not Prime\n”); return 0;}   return 1; } Let T(n) denotes… Read More
An array of n numbers is given, where n is an even number. The maximum as well as the minimum of these n numbers needs… Read More
Let w be the minimum weight among all edge weights in an undirected connected graph. Let e be a specific edge of weight w .… Read More
Which of the following is TRUE about formulae in Conjunctive Normal Form? (A) For any formula, there is a truth assignment for which at least… Read More
Consider the process of inserting an element into a Max Heap, where the Max Heap is represented by an array. Suppose we perform a binary… Read More
Consider the following C program segment where CellNode represents a node in a binary tree: struct CellNode  {   struct CellNOde *leftChild;   int element;   struct CellNode… Read More
What is the time complexity of the following recursive function: int DoSomething (int n)  {   if (n <= 2)     return 1;   else       return (DoSomething (floor(sqrt(n)))… Read More
In the following C function, let n >= m. int gcd(n,m) {   if (n%m ==0) return m;     n = n%m;   return gcd(m,n); } How many… Read More
A complete n-ary tree is a tree in which each node has n children or no children. Let I be the number of internal nodes… Read More
Consider the following C function, what is the output? #include <stdio.h> int f(int n) {     static int r = 0;     if (n <= 0) return… Read More
In an unweighted, undirected connected graph, the shortest path from a node S to every other node is computed most efficiently, in terms of time… Read More