GATE CS 1999 · Arrays & Matrix Representation

MCQ · 1 mark · Problem PROG-DSTR-0255

Suppose we want to arrange the n numbers stored in any array such that all negative values occur before all positive ones. Minimum number of exchanges required in the worst case is
  1. A
    n-1
  2. B
    n
  3. C
    n+1
  4. D
    None of the above

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: Option D.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/1466/gate1999-1-13

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com