Link to home
Start Free TrialLog in
Avatar of RamiScience
RamiScience

asked on

Sort By Selection Algorithm By RECURSION

Hello
  I want the algorithm of :
       Sort By Selection function of a array of integer elements  
   by RECURSION .
 
  SortBySelec(int a[]; int n);
  {
  }

 Thanks.....................
Avatar of Zoppo
Zoppo
Flag of Germany image

Homework?
ASKER CERTIFIED SOLUTION
Avatar of TheLord
TheLord

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
void SortBySelec(int* a; int n);
{
    if(n == 1) retun;
    int j = 0;
    for(int i=1; i<n; i++)
       if(a[i] < a[0])
           j = i;
    a[0] = a[j];
    SortBySelec(&a[1], n-1);
}