Solved

Sort By Selection Algorithm By RECURSION

Posted on 2002-05-27
3
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 31

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Losing latter half of command line in Visual Studio C++ online program 10 97
C++ Language error 28 314
How to gracefully close the c++ 11 thread? 3 160
print bytes of an integer 6 48
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

734 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