본문내용
t++){
if(heap[first].key[count] != heap[second].key[count])
/* heap의 key값을 하나하나 차례로 비교해서 하나라도 다를 경우 FALSE를 반환한다. */
flag=FALSE;
}
return flag;
}
void copy(char *a, char *b){
int first, second, count;
first = compare(a); /* 현 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값을 하나하나 차례로 복사한다. */
}
}
hw9.out
[Menu: 1.Insert, 2.Delete, 3.Pre, 4.In, 5.Post, 6.Level, 7.Copy, 8.Equal, 9.Exit]choice? i heap1
Enter the number(s) to be inserted to heap1: 30 50 10 80 5 40 20 100
choice? M
[Menu: 1.Insert, 2.Delete, 3.Pre, 4.In, 5.Post, 6.Level, 7.Copy, 8.Equal, 9.Exit]choice? i heap1
Enter the number(s) to be inserted to heap1: 1
choice? n heap1
30 50 1 80 5 100 10 40 20
choice? c heap1 heap2
choice? n heap2
30 50 1 80 5 100 10 40 20
choice? e heap2 heap1
They are equivalent!
choice? i heap2
Enter the number(s) to be inserted to heap2: 200
choice? e heap1 heap2
They are not equivalent!
choice? d heap1
choice? p heap1
80 50 30 1 5 40 10 20
choice? x
Thanks to you, Using my program. Have a nice Day!
if(heap[first].key[count] != heap[second].key[count])
/* heap의 key값을 하나하나 차례로 비교해서 하나라도 다를 경우 FALSE를 반환한다. */
flag=FALSE;
}
return flag;
}
void copy(char *a, char *b){
int first, second, count;
first = compare(a); /* 현 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값을 하나하나 차례로 복사한다. */
}
}
hw9.out
[Menu: 1.Insert, 2.Delete, 3.Pre, 4.In, 5.Post, 6.Level, 7.Copy, 8.Equal, 9.Exit]choice? i heap1
Enter the number(s) to be inserted to heap1: 30 50 10 80 5 40 20 100
choice? M
[Menu: 1.Insert, 2.Delete, 3.Pre, 4.In, 5.Post, 6.Level, 7.Copy, 8.Equal, 9.Exit]choice? i heap1
Enter the number(s) to be inserted to heap1: 1
choice? n heap1
30 50 1 80 5 100 10 40 20
choice? c heap1 heap2
choice? n heap2
30 50 1 80 5 100 10 40 20
choice? e heap2 heap1
They are equivalent!
choice? i heap2
Enter the number(s) to be inserted to heap2: 200
choice? e heap1 heap2
They are not equivalent!
choice? d heap1
choice? p heap1
80 50 30 1 5 40 10 20
choice? x
Thanks to you, Using my program. Have a nice Day!
추천자료
- [자료구조] BFS&DFS&BST
- [자료구조] post&prefix
- 자바 자료구조 족보
- (자료구조) 스레드 이진트리 중위운행 결과 소스
- (자료구조) 트리를 이용한 비순환적 중위운행 결과 소스
- 리스트 자료구조를 이용한 상입,제거(특정 토큰에 대해)
- [자료구조]Infix로 된 수식을 Prefix와 Postfix로 변환 시키는 프로그램입니다.(C언어)
- 알고리즘, 자료구조 중 '문자열매칭' ppt 개념설명 수업시연
- 2010년 2학기 자료구조 출석대체시험 핵심체크
- 철근 콘크리트 구조.PPT자료
- 연결리스트(자료구조).ppt
- [자료구조] 피보나치수열 - int 데이타 사이즈를 넘어가는 결과값 계산 프로그램
- C언어 자료구조 Binary Search Tree (이진 탐색 트리)
- C언어 자료구조 HashTable 해시테이블
소개글