Solved

Sort By Selection Algorithm By RECURSION

Posted on 2002-05-27
3
163 Views
Last Modified: 2010-04-02
Hello
  I want the algorithm of :
       Sort By Selection function of a array of integer elements  
   by RECURSION .
 
  SortBySelec(int a[]; int n);
  {
  }

 Thanks.....................
0
Comment
Question by:RamiScience
3 Comments
 
LVL 30

Expert Comment

by:Zoppo
ID: 7038525
Homework?
0
 

Accepted Solution

by:
TheLord earned 200 total points
ID: 7038584
0
 
LVL 22

Expert Comment

by:ambience
ID: 7038623
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);
}
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now