# Thread: Making selection sort into a recursive method.

1. Member
Join Date
Sep 2012
Posts
3
Rep Power
0

## Making selection sort into a recursive method.

How would I modify this version of a selection sort into a recursive method?

public static void selectionSortRecursive(Comparable [] list, int n)

{
int min;
Comparable temp;

for(int index =0; index < n-1; index++){
min = index;
for(int scan= index+1; scan<list.length; scan++)

if (list[scan].compareTo(list[min])< 0)
min = scan;
temp = list[min];
list[min]= list[index];
list[index]=temp;
}

2. ## Re: Making selection sort into a recursive method.

You didn't bother to return to the thread you started two years ago. Why should we expect any better behavior this time round?

db

3. Just a guy
Join Date
Jun 2013
Location
Netherlands
Posts
5,114
Rep Power
12

## Re: Making selection sort into a recursive method.

Whoa, you're a harsh law enforcer :) A one time offense two years ago and then still the whip is cracked. I pity the fool who commits minor forum abuse within the same week.

4. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
6,226
Rep Power
13

## Re: Making selection sort into a recursive method.

Originally Posted by gimbal2
Whoa, you're a harsh law enforcer :)
Yeah.. Isn't it great!

Regards,
Jim

5. Member
Join Date
Sep 2012
Posts
3
Rep Power
0

## Re: Making selection sort into a recursive method.

Originally Posted by DarrylBurke
You didn't bother to return to the thread you started two years ago. Why should we expect any better behavior this time round?

db
Well, sorry about that. But I'm here now so would you mind helping a novice programmer out? I couldn't find any other examples exactly like this online and I am having trouble with the logic myself.

6. Just a guy
Join Date
Jun 2013
Location
Netherlands
Posts
5,114
Rep Power
12

## Re: Making selection sort into a recursive method.

Examples of what exactly?

I hope you are looking for information on how recursive methods work and not for an example of your precise requirement which you can copy from. A Google for "java recursive method" returns plenty of examples, most with proper explanations too.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•