GATE | GATE CS 1999 | Question 13
Suppose we want to arrange the ii 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:
(D) None of the above
Explanation: When we have ‘i’ numbers stored in an array, we have to swap all positive numbers with negative and in worst case positive numbers will be i/2.
Quiz of this Question
Attention reader! Don’t stop learning now. Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.
Learn all GATE CS concepts with Free Live Classes on our youtube channel.