Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

Sort By Selection Algorithm By RECURSION

Posted on 2002-05-27
Medium Priority
184 Views
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
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

LVL 31

Expert Comment

ID: 7038525
Homework?
0

Accepted Solution

TheLord earned 800 total points
ID: 7038584
0

LVL 22

Expert Comment

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

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses
Course of the Month8 days, 16 hours left to enroll