Math, asked by Gitanjali5490, 9 months ago

An array contains both positive and negative numbers in random order. Rearrange the array elements so that all negative numbers appear before all positive numbers.

Answers

Answered by jsw24
0

Answer:

It really depends on the numbers in the set, but order the numbers from least to greatest. Remember that a negative value is less than another when it is greater than the other value when both are multiplied by -1. Hope that makes sense. Here's an example: [9, 6, -2, 0, -9, 1, -4] => [-9, -4, -2, 0, 1, 6, 9]

Step-by-step explanation:

Similar questions