|
68
78
n=4
17
8
11
3
21
30
42
60
68
78
n=3
11
8
3
17
21
30
42
60
68
78
n=2
8
3
11
17
21
30
42
60
68
78
n=1
3
8
11
17
21
30
42
60
68
78
정렬된 상태
3
8
11
17
21
30
42
60
68
78 ․Heap의 정의
․Heap의 종류
․우선순위 큐(Priority Queue)
․Heap
․힙 정렬의 방법
|
- 페이지 4페이지
- 가격 1,000원
- 등록일 2005.05.24
- 파일종류 한글(hwp)
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
heapsort(int a[], int size)
{
int i;
buildHeap(a, size);
for(i=(size-2); i>=0; i--)
{
swap(&a[0], &a[i+1]);
formHeap(a, 0, i);
}
}
void printList(int list[], int size)
{
int i;
for(i=0; i<size; i++)
printf(\"%d \", list[i]);
printf(\"\\n\");
}
void main(){
int list[MAX], size, i;
printf(\"정렬
|
- 페이지 4페이지
- 가격 1,200원
- 등록일 2010.02.24
- 파일종류 한글(hwp)
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
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페이지
- 가격 500원
- 등록일 2010.07.22
- 파일종류 기타
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
heap 성질의 tree로 바꾸어 준다. 이때, 최하위 subtree에서부터 heap으로 바꾸어 주며 올라가 마침내 전체 tree를 heap화 시킨다. 이렇게 heap tree로 바뀐 문제를 heap sorting 을 사용하여 정렬하는 것이 문제의 핵심이다.
1) 프로그
|
- 페이지 5페이지
- 가격 800원
- 등록일 2009.05.11
- 파일종류 압축파일
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
- 힙 정렬 (Heap Sort)
void heap_sort(int *list, int n)
{
int i, temp;
for(i=(n/2); i>=1; i--) // 초기 히프 만들기
adjust(list, i, n);
for(i=(n-1); i>=1; i--) { // 히프 정렬의 두 번째 단계
temp = list[i+1]; // 마지막 노드와 뿌리 노드
|
- 페이지 9페이지
- 가격 1,000원
- 등록일 2004.04.16
- 파일종류 워드(doc)
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|