1
GATE CSE 2004
MCQ (Single Correct Answer)
+1
-0.3
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 2004
MCQ (Single Correct Answer)
+2
-0.6
Two matrices M1 and M2 are to be stored in arrays A and B respectively. Each array can be stored either in row-major or column-major order in contiguous memory locations. The time complexity of an algorithm to compute M1$$\times$$ M2 will be
A
Best if A is in row-major and B is in column-major order
B
Best if both are in row-major order
C
Best if both are in column-major order
D
Independent of the storage scheme
3
GATE CSE 2004
MCQ (Single Correct Answer)
+1
-0.3
The best data structure to check whether an arithmetic expression has balanced parentheses is a
A
queue
B
stack
C
tree
D
list
4
GATE CSE 2004
MCQ (Single Correct Answer)
+2
-0.6
Assume that the operators +, -, ×, are left associative and ^ is right associative. The order of precedence (from highest to lowest) is ^, ×, +, -. The postfix expression corresponding to the infix expression a + b×c-d^e^f is
A
abc×+def^^-
B
abc×+de^f^-
C
ab+c×d-e^f^
D
- + a×bc^^def
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