NEW
New Website Launch
Experience the best way to solve previous year questions with mock tests (very detailed analysis), bookmark your favourite questions, practice etc...
1

GATE CSE 2004

MCQ (Single Correct Answer)
A single array A[1..MAXSIZE] is used to implement two stacks, The two stacks grow from opposite ends of the array. Variables top1 and top2 (top1 < top2) point to the location of the topmost element in each of the stacks, If the space is to be used efficiently, the condition for "stack full" is
A
(top 1 = MAXSIZE/2) AND (top 2 = MAXSIZE/2 + 1)
B
top 1 + top 2 = MAXSIZE
C
(top 1 = MAXSIZE/2) or (top 2 = MAXSIZE)
D
top 1 = top 2 - 1
2

GATE CSE 2000

MCQ (Single Correct Answer)
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)
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$$
Write for Us

Do you want to write for us? Help us by contributing to our platform.

Questions Asked from Arrays

On those following papers in Marks 1
Number in Brackets after Paper Indicates No. of Questions
GATE CSE 2020 (1)
GATE CSE 2005 (1)
GATE CSE 2004 (1)
GATE CSE 2000 (2)

Joint Entrance Examination

JEE Main JEE Advanced WB JEE

Graduate Aptitude Test in Engineering

GATE CSE GATE ECE GATE EE GATE ME GATE CE GATE PI GATE IN

Medical

NEET

CBSE

Class 12