Skip to content
Snippets Groups Projects
Commit c9b62645 authored by Darius's avatar Darius
Browse files

ajoute fonction qui affiche l'arbre

parent 92d52243
No related branches found
No related tags found
No related merge requests found
...@@ -67,12 +67,23 @@ struct node_t * pushTree(struct node_t * tree, char letter, char * code){ ...@@ -67,12 +67,23 @@ struct node_t * pushTree(struct node_t * tree, char letter, char * code){
} }
} }
void printTree(struct node_t * tree, int depth){}
struct node_t * encodeMorse(struct node_t * tree, char * path){}
char searchCodeTree(struct node_t * tree, char letter, char* code_out){} char searchCodeTree(struct node_t * tree, char letter, char* code_out){}
struct node_t * encodeMorse(struct node_t * tree, char * path){}
void decodeMorse(struct node_t * tree, char * path){} void decodeMorse(struct node_t * tree, char * path){}
void printTree(struct node_t * tree, int depth){
if (tree == NULL) {
return;
}
printTree(tree->right, depth + 1);
for (int i = 0; i < depth; i++) {
printf(" ");
}
printf("%c\n", tree->letter);
printTree(tree->left, depth + 1);
}
void destroyTree(struct node_t ** tree){} void destroyTree(struct node_t ** tree){}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment