Code:
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
main()
{
int arr[]={1,4,8,6,5,4,3,0};
int x=sizeof(arr)/sizeof(arr[0]);
stable_sort(arr,arr+x,greater<int>());
cout<<"\nResort:";
for(int z=0;z<x;z++)
cout<<" "<<arr[z];
cout<<"\nSort :";
stable_sort(arr,arr+x);
for(int v=0;v<x;v++)
cout<<" "<<arr[v];
}
Output:
0 Comments