C++ Recursion Sort

Sun May 25, 2008 2:44 pm

This code for sorting an array using recursion function
cpp code
#include<iostream.h>
int MAX(int a,int b)
{
if(a>b)
return a;
return b;

}
int MAX(int a[],int SIZE )
{
if(SIZE==1)return a[0];
return MAX(a[SIZE-1],MAX(a,SIZE-1));
}
int[] Sort(int a[],int Size)
{
int temp;
temp=a[0]
a[0]=MAX(a,Size);








}
void main()
{

int a[6]={6,5,4,3,78,7};
cout<<Sort(a,6)<<endl;



}




  Related Posts  to : C++ Recursion Sort
 Function Recursion     -  
 factorial number Using Recursion     -  
 code to find a number all divisors using recursion     -  
 C++ Selection Sort     -  
 Library Sort     -  
 selection sort     -  
 String Sort     -  
 Insertion Sort (C++)     -  
 sort words in c++     -  
 Sort a list     -  

Topic Tags

C++ Sorting