C++ > Algorithms
Merge Sort
Merge Sort #include
int a[50]; void merge(int,int,int); void merge_sort(int low,int high) { int mid; if(low
mid) { for(k=j;k<=high;k++) { b[i]=a[k]; i++; } } else { for(k=h;k<=mid;k++) { b[i]=a[k]; i++; } } for(k=low;k<=high;k++) a[k]=b[k]; } void main() { int num,i; cout<<"******************************************************************* *************"<
>num; cout<
>a[i] ; } merge_sort(1,num); cout<
C++ Codes
Algorithms
Beginners
Code Snippets
Graphics
Data Structures
Games
Mathematics
Miscellaneous