The QuickSort algorithm and the MergeSort algorithm can efficiently rearrange the elements of a given array of real numbers.
Both the QuickSort algorithm and the MergeSort algorithm can efficiently rearrange the elements of a given array of real numbers so that all negative elements precede all positive elements.
The QuickSort algorithm works by selecting a pivot element, partitioning the array into two sub-arrays (one with negative elements and the other with positive elements), and then recursively sorting the sub-arrays.
The MergeSort algorithm works by dividing the array into two halves, sorting each half separately, and then merging the sorted halves to obtain the final sorted array.