1
GATE CSE 2005
MCQ (Single Correct Answer)
+2
-0.6
The following C function takes a single-linked list of integers as a parameter and rearranges the elements of the list. The function is called with the list containing the integers 1,2,3,4,5,6,7 in the given order. What will be the contents of the list after the function completes execution?
struct node { 
    int value; 
    struct node *next; 
}; 

Void rearrange (struct node *list ){ 
    struct node *p, * q; 
    int temp; 
    if( !list || !list-> next) return; 
    p = list; q = list->next; 
    while (q) { 
      temp = p->value; 
      p-> value = q ->value; 
      q-> value = temp; 
      p = q-> next; 
      q = p ? p->next : 0; 
    } 
}
A
1,2,3,4,5,6,7
B
2,1,4,3,6,5,7
C
1,3,2,5,4,7,6
D
2,3,4,5,6,7,1
2
GATE CSE 2005
MCQ (Single Correct Answer)
+1
-0.3
A function f defined on stacks of integers satisfies the following properties. f(∅) = 0 and f (push (S, i)) = max (f(S), 0) + i for all stacks S and integers i. If a stack S contains the integers 2, -3, 2, -1, 2 in order from bottom to top, what is f(S)?
A
6
B
4
C
3
D
2
3
GATE CSE 2005
MCQ (Single Correct Answer)
+1
-0.3
A program P reads in 500 integers in the range [0, 100] representing the cores of 500 students. It then print the frequency of each score above 50. What would be the best way for P to store the frequencies?
A
An array of 50 numbers
B
An array of 100 numbers
C
An array of 500 numbers
D
A dynamically allocated array of 550 numbers
4
GATE CSE 2005
MCQ (Single Correct Answer)
+2
-0.6
In an inventory management system implemented at a trading corporation, there are several tables designed to hold all the information. Amongst these, the following two tables hold information on which items are supplied by which suppliers, and which warehouse keeps which items along with the stock-level of these items.

Supply = (supplierid, itemcode)
Inventory = (itemcode, warehouse, stocklevel)

For a specific information required by the management, following SQL query has been written

Select distinct STMP.supplierid 
From Supply as STMP 
Where not unique (Select ITMP.supplierid 
    From Inventory, Supply as ITMP 
    Where STMP.supplierid = ITMP.supplierid 
    And ITMP.itemcode = Inventory.itemcode 
    And Inventory.warehouse = 'Nagpur');
For the warehouse at Nagpur, this query will find all suppliers who
A
do not supply any item
B
supply exactly one item
C
supply one or more items
D
supply two or more items
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12