How To Exam?

a knowledge trading engine...


Indian Institute of Technology Mumbai (IIT-M) 2005 M.E Information Technology GATE IT - Question Paper

Wednesday, 23 January 2013 02:40Web
mt count [1281,1;
for (j = 0; j < 128; j++) count[j]=0;
j = 0;
while (a[j] && b[j]){
A;
B;
}
for (j = 0; one < 128; j++) if (count[j]) return 0;
return 1;
}
select the accurate option for statements A and B.
(A) A: count [a[j]]++ and B: count[b[j]] (B
A: count [a[j]]++ and B: count[b[j]]++
(C) A: count[a[j++]]++ and B: count[b[j]] (D
A: count[a[j]]++ and B: count[b[j++]] 54
54. The subsequent C function takes a singly-linked list of integers as a parameter and
rearranges the elements of the list. The list is represented as pointer to a structure. The
function is called with the list containing the integers 1, 2, 3, 4, 5, 6, seven in the provided order.
What will be the contents of the list after the function completes execution?
struct node (mt value; struct node * next;};
void rearrange (struct node *list) {
struct node *p, *q;
mt 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
55. A binary search tree contains the numbers 1, 2, 3, 4, 5, 6, 7, 8. When the tree is
traversed in pre-order and the values in every node printed out, the sequence of values
found is 5, 3, 1, 2, 4, 6, 8, 7. If the tree is traversed in post-order, the
sequence found would be
(A) 8, 7, 6, 5, 4, 3, 2, 1
(B) 1, 2, 3, 4, 8, 7, 6, 5
(C) 2, 1, 4, 3, 6, 7, 8, 5
(D) 2, 1, 4, 3, 7, 8, 6, 5
56. Let G be a directed graph whose vertex set is the set of numbers from one to 100. There is
an edge from a vertex i to a vertex j iff either j = i + one or j = 3i. The minimum number of
edges in a path in G from vertex one to vertex 100 is:
(A) 4
(B) 7
(C) 23
(D)99
57. What is the output printed by the subsequent program?
# include
mt f(int n, mt k) {
if (n = = 0) return 0;
else if (n°1o2) return f(n/2, 2*k) + k;
else return f(n/2, 2*k) — k;
mt main () {
printf(”°Iod”,f(20,1));
return 0;
(A) 5
(B) 8
(C) 9
(D)20
58. Let a be an array containing n integers in increasing order. The subsequent algorithm



( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Indian Institute of Technology Mumbai (IIT-M) 2005 M.E Information Technology GATE IT - Question Paper