정렬알고리즘 총 집합 소스입니다.
- 최초 등록일
- 2013.08.28
- 최종 저작일
- 2010.04
- 10페이지/ 한컴오피스
- 가격 5,000원
목차
없음
본문내용
#include
#include
#include
//소팅 함수
void ascending_selectionSort(int *a, int size);
void ascending_bubbleSort(int *a, int size);
void ascending_insertionSort(int *a, int size);
void count_sort(int *a,int *b, int n);
void descending_selectionSort(int *a, int n);
void descending_bubbleSort(int *a, int n);
void descending_insertionSort(int *a, int n);
void mergeSort(int a[], int size, int middle);
void merge(int a[],int p, int q, int r);
int partition(int a[] , int p, int r);
void quickSort(int a[], int p, int r);
void buildHeap(int a[], int n);
void heapSort(int a[], int n);
void heapify(int a[], int k, int n);
int thesmallest(int *a, int last);
int theLargest(int *a, int size);
< 중 략 >
//병합 정렬
void merge(int a[],int p, int q, int r){
int i=p, j=q+1, t=0, *temp;
temp= malloc(sizeof(int)*(r-p+1));
while(i<=q && j<=r){
if(a[i]<=a[j])
temp[t++]=a[i++];
else
temp[t++]=a[j++];
}
while(i<=q)
temp[t++]=a[i++];
while(j<=r)
temp[t++]=a[j++];
참고 자료
없음