diff --git a/sorting/rankSort.cpp b/sorting/rankSort.cpp new file mode 100644 index 000000000..070a7026a --- /dev/null +++ b/sorting/rankSort.cpp @@ -0,0 +1,43 @@ +#include +using namespace std; + +void rankSort(int arr[],int n){ + int rank[n]; + int out[n]; + + for(int i=0;iarr[j]) + rank[i]++; + } + } + + for(int i=0;i>n; + int arr[n]; + cout<<"enter the elements\n"; + for(int i=0;i>arr[i]; + } + rankSort(arr,n); + +return 0; +}