Question: In given list of ve and +ve numbers, write a program to separate ve numbers from the +ve numbers. //Sorts a given list by selection
In given list of –ve and +ve numbers, write a program to separate –ve numbers from the +ve numbers.![//Sorts a given list by selection sort //Input: An array A[0..n-1] of](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1708/9/2/6/69765dc26e9ee3851708926696722.jpg)
//Sorts a given list by selection sort //Input: An array A[0..n-1] of orderable elements. //Output: List A[0..n-1] sorted in ascending order Algorithm SelectionSort (A[0..n-1]) for i= to n - 2 do min = i for j = i + 1 to n - 1 do if A[j] A[min] min = j swap A[i] and A[min]
Step by Step Solution
3.47 Rating (157 Votes )
There are 3 Steps involved in it
The question involves sorting a given list of numbers using the selection sort algorithm and then separating the negative numbers from the positive numbers in the sorted list Here are the key steps in... View full answer
Get step-by-step solutions from verified subject matter experts
