Suppose we want to arrange the n numbers stored in an array such that all…

PYQ GATE 1999

Suppose we want to arrange the n numbers stored in an 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

Attempted by 546 students.

Sign up free to check your answer

Sign up free

Explore the full course: Algorithms

Loading lesson…