Design Implement Selection Sort Algorithm Sort List Number Largest Smallest Numbers 01 5 1 Q37124357

Design and implement a selection sort algorithm to sort a listof number from the largest to the smallest.

The numbers are: 0.1 5 10.5 9.8 3.3 5.6 8.5 7.3 1.5 99.930.4

Design and implement a merge sort algorithm to sort a list ofnumber from the largest to the smallest.

The numbers are: 0.1 5 10.5 9.8 3.3 5.6 8.5 7.3 1.5 99.930.4


Solution


If you have any doubts, please give mecomment…

#include<iostream>

using namespace std;

void selectionSort(double nums[], int n);

void merge(double nums[], int l, int m, int r);

void mergeSort(double nums[], int l, int r);

void print(double nums[], int n);

int main(){

cout<<“Selection Sort: “<<endl;

double nums[] = {0.1, 5, 10.5,

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.