1
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$$
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)
+1
-0.3
Consider the following nested representation of binary trees: (X Y Z) indicates Y and Z are the left and right sub stress, respectively, of node X. Note that Y and Z may be NULL, or further nested. Which of the following represents a valid binary tree?
A
(1 2 (4 5 6 7))
B
(1 (2 3 4) 5 6) 7)
C
(1 (2 3 4)(5 6 7))
D
(1 (2 3 NULL) (4 5))
4
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
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12