avl tree
- 최초 등록일
- 2007.07.12
- 최종 저작일
- 2006.05
- C언어
- 가격 2,500원
소개글
avl tree를 만들고, 새로 삽입 삭제가 가능한 것이다.
삽입 삭제후에도 avl tree인지 아닌지를 판단해준다.
컴파일 실행환경
Microsoft visual c++,
본문내용
#소스일부
int main()
{
int i,input;
tree_ptr head = NULL;
printf("트리를 구성할 5개의 노드값을 입력해주세요\n");
for(i=0; i < 5; i++)
{
scanf("%d",&input);
//make binary search tree
head = make_bst(head,input);
//treedepth(head);
printf("트리의 깊이는 %d\n",treedepth(head));
printf("왼쪽트리의 깊이는 %d, 오른쪽트리의 깊이는 %d\n\n",arr[0],arr[1]);
}
if( minus() <= -2 || minus() >= 2 ) {
printf("AVL트리가 아니므로 정렬시켜줍니다.\n\n");
head = cpr_depth(head);
참고 자료
없음