1
GATE CSE 2000
MCQ (Single Correct Answer)
+2
-0.6
Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a postorder, inorder and preorder traversal. Respectively, of a complete binary tree. Which of the following is always tree?
A
LASTIN = LASTPOST
B
LASTIN = LASTPRE
C
LASTPRE = LASTPOST
D
None of the above
2
GATE CSE 2000
MCQ (Single Correct Answer)
+1
-0.3
Suppose you are given an array s[1..n] and a procedure reverse (s, i, j) which reverse the order of elements in s between positions i and j (both inclusive). What does the following sequence do, where $$1 \le k < n:$$ reverse (s, 1, k);
reverse (s, k+1, k);
reverse (s, 1, n);
A
Rotates s left by k positions
B
Leaves s unchanged
C
Reverse all elements of s
D
None of the above
3
GATE CSE 2000
MCQ (Single Correct Answer)
+2
-0.6
Let G be an undirected graph. Consider a depth-first traversal of G, and let T be the resulting depth-first search tree. Let u be a vertex in G and let v be the first new (unvisited) vertex visited after visiting u in the traversal. Which of the following statements is always true?
A
{u, v} must be an edge in G, and u is a descendant of v in T
B
{u, v} must be an edge in G, and v is a descendant of u in T
C
If {u, v} is not an edge in G then u is a leaf in T
D
If {u, v} is not an edge in G then u and v must have the same parent in T
4
GATE CSE 2000
MCQ (Single Correct Answer)
+1
-0.3
An n $$\times$$ n array v is defined as follows V [i, j] = i - j for all i, j, $$1 \le i \le n,\,1 \le j \le n$$ The sum of the elements of the array v is
A
0
B
n - 1
C
$${n^2} - 3n + 2$$
D
$${n^2}(n + 1)/2$$
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