PA of Algorithms Q93

0. 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

  • Option : D
  • Explanation :
    When we have ā€˜n’ numbers stored in an array, we have to swap all positive number with negative number so in worst case positive numbers will be n/2,
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *