C언어로 작성한 힙 정렬 ( Heap Sort ) - 자료구조
본 자료는 미리보기를 지원하지 않습니다.
닫기
  • 1
  • 2
  • 3
해당 자료는 1페이지 까지만 미리보기를 제공합니다.
1페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

C언어로 작성한 힙 정렬 ( Heap Sort ) - 자료구조에 대한 보고서 자료입니다.

본문내용

#include
#include
#define N 100000
void make_heap(int a[], int n);
void heapify(int a[], int n, int k);
void heap_sort(int a[], int n);
void swap(int *a, int *b);
void bubble_sort(int a[],int n);
clock_t before;
void start_time(void){
before=clock();
}
double prn_time(void)
{
double user_time;
user_time=(double)(clock()-before)/CLOCKS_PER_SEC;
before=clock();
printf("정렬되는데 걸린 시간 : %3.3lf seconds\n",user_time);
return user_time;
}
void make_heap(int a[], int n)
{
int k;
for (k=n/2;k>=0;k--)
{
heapify(a, n, k);
}
}
void heapify(int a[ ], int n, int k)
{
int temp, i;
temp=a[k];
i=k*2;
if(i {
if(a[i] i=i++;
}
if(temp {

키워드

자료구조,   ,   정렬,   Heap,   Sort,   알고리즘,   C언어
  • 가격500
  • 페이지수3페이지
  • 등록일2010.07.22
  • 저작시기2009.4
  • 파일형식기타(cpp)
  • 자료번호#624940
본 자료는 최근 2주간 다운받은 회원이 없습니다.
  • 편집
  • 내용
  • 가격
청소해
다운로드 장바구니