Data Structures
Stacks and Queues
Marks 1Marks 2
Linked List
Marks 1Marks 2
1
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, n);
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
GATE CSE Subjects
Theory of Computation
Operating Systems
Algorithms
Digital Logic
Database Management System
Data Structures
Computer Networks
Software Engineering
Compiler Design
Web Technologies
General Aptitude
Discrete Mathematics
Programming Languages
Computer Organization