/* Merge Sort
g0tch4.blogspot.com */
#include "iostream.h"
#include "conio.h"
void merge(long [], int, int);
void merge_sort(long [], int);
main()
{
clrscr();
const int array_size = 10;
long array[array_size] = {0};
cout<<"******************************************"<< count_1="0;">>array[count_1];
merge_sort(array, array_size);
gotoxy(35,10);
cout<<"Elemen-Elemen Yang Sudah di Sortir : ";
for(int count_2=0;count_2 < temp_array =" new" count_1 =" 0;" count_2 =" 0;" count_3 =" 0;" count_4="0;">1)
{
int sub_array_size_1 = array_size/2;
int sub_array_size_2 = array_size - sub_array_size_1;
merge_sort(array, sub_array_size_1);
merge_sort(array+sub_array_size_1, sub_array_size_2);
merge(array, sub_array_size_1, sub_array_size_2);
}
}
13 Januari 2009
Merge Sort (Turbo C++)
Langganan:
Posting Komentar (Atom)
1 komentar:
bozz minta marge sort yang dari pascal nya ya,.
source code nya
thazX
Posting Komentar