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
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
Social Sciences,
5 months ago
Hindi,
5 months ago
Science,
5 months ago
English,
10 months ago
Physics,
10 months ago