Professional Documents
Culture Documents
struct Node{
int data;
Node *firstChild;
Node *nextSibling;
};
typedef struct TreeADT *Tree;
struct TreeADT{
Node *root;
};
Ci t cc hm di y. Lu , bn cn phi tm mt cch kim tra cc hm bn ci
t.
// To mt cy t mt tp tin m trong tt c cc s lin tip nhau c cng node cha
nm trn mt dng ring v cch nhau bi du cch theo th t duyt cy tin th t
(preorder)
Tree createTree(char *filename);
//In ra gi tr cc nt ca cy theo th t duyt cy tin th t(preorder)
void Preorder(Tree t);
struct Node{
int data;
Node *left;
Node *right;
};
typedef struct BinaryTreeADT *BinaryTree;
struct BinaryTreeADT{
Node *root;
};
Ci t cc hm di y. Lu , bn cn phi tm mt cch kim tra cc hm bn ci
t.
//
To mt cy nh phn t mt tp tin m trong tt c cc s nm trn mt dng v
cch nhau bi du cch theo th t duyt cy trung th t (inorder)
BinaryTree createTree(char *filename);
//In ra gi tr tt c cc nt ca cy theo th t duyt cy theo mc (levelorder)
void TraversalLevel(BinaryTree t);