Data Structures HW4
- 최초 등록일
- 2012.12.01
- 최종 저작일
- 2011.05
- 14페이지/ 한컴오피스
- 가격 2,000원
소개글
연세대학교 데이타구조 숙제입니다. 만점받았습니다
목차
(1) Brief explanation of the problem
(2) Your view as to how it ties in with what we covered in class
(3) Discussion of your result
(4) Short explanation of your code
(5) Your code
본문내용
(1) Brief explanation of the problem
The goal of this problem is that we should understand tree structure and make tree structure. And our code should carry out tree traversal. So I must show the words written in the problem in alphabetical order.
(2) Your view as to how it ties in with what we covered in class
The most what we covered in class is Tree and linked list. To make tree, we should use linked list as before we did. A tree is connected between vertices with no cycle. So between any two vertices, there is exactly one unique path. And the tree is composed of rooted tree, depth, height, ancestor, descendant, parent, child and sibling. Tree always has one rooted tree. And if a vertex of tree has no children then it is called a leaf. The advantage of tree is short time average.
<중 략>
while(print->left!=NULL){
printf("%c",print->left->word);
print->left=print->left->left;
}
printf("\n");
/*
fat의 출력
*/
print=fix->sibling; //print를 f로 돌려온다
while(print!=NULL){
printf("%c",print->word);
print=print->left;
}
printf("\n");
/*
go의 출력
*/
print=fix->sibling->sibling;//print를g자리로 돌려온다.
while(print!=NULL){
printf("%c",print->word);
print=print->left;
}
printf("\n");
/*
hat의 출력
*/
print=fix->sibling->sibling->sibling; //print를 h자리로 돌려온다
while(print!=NULL){
참고 자료
없음