|
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#define TRUE 1
#define FALSE 0
#define max_heapsize 200
typedef struct heap {
int data[max_heapsize];
int size;
} heap;
int init_heap(heap *);
int insert_heap(heap *,
|
- 페이지 1페이지
- 가격 1,300원
- 등록일 2012.11.13
- 파일종류 기타
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
heap의 name을 결정한다 */
second = compare(b); /* 현 heap의 name을 결정한다 */
heap[second].count = heap[first].count; /* heap의 원소의 갯수를 복사한다. */
for(count=0; count < MAX_ELEMENTS ; count++){
heap[second].key[count] = heap[first].key[count]; /* heap의 key값을 하나하나 차
|
- 페이지 6페이지
- 가격 1,000원
- 등록일 2003.09.28
- 파일종류 한글(hwp)
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
// define,undef,ifdef,elif,else,endif매크로 나올때
// 힙에 상입,제거 하는 함수
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_MACRO_NUM 200
#define HEAP_FULL(n) (n==MAX_MACRO_NUM-1)
#define HEAP_EMPTY(n) (!n)
typedef struct {
char *name;
cha
|
- 페이지 8페이지
- 가격 2,500원
- 등록일 2006.05.03
- 파일종류 기타
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
힙정렬을 수행하는 함수
void heapsort(int n)
{
int i,j ;
for(i = n/2 ; i > 0 ; i--)
adjust( i , n); //adjust를 이용하여 최대힙을 구축
for(j = n-1 ; j > 0 ; j--)
{
swap(&list[1], &list[j+1]); //루트의 자리 교환
adjust( 1, j); //루트의 자리 교환후 힙 재구성
}
}
void swa
|
- 페이지 9페이지
- 가격 2,000원
- 등록일 2004.10.05
- 파일종류 한글(hwp)
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
;
for(i=1; i<=6 ; i++) {
printf(\"%d번째 값: %d\\n\",i,heap1.heap[i]);
}
printf(\"------------------------------\\n\");
printf(\"우선순위가 높은 값 부터 출력\\n\");
printf(\"%d\\n\",delete_max_heap(&heap1)); //우선순위큐 반환
printf(\"%d\\n\",delete_max_heap(&heap1));
printf(\"%d\\n\",delete_
|
- 페이지 3페이지
- 가격 3,000원
- 등록일 2009.09.25
- 파일종류 한글(hwp)
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|