Yûki - Huffman

This commit is contained in:
name 2019-12-14 22:15:45 +01:00
parent 6c967c6fac
commit 7acf2f20fa
No known key found for this signature in database
GPG key ID: 03E8F3CF3183323A
4 changed files with 38 additions and 17 deletions

View file

@ -1,9 +1,10 @@
#ifndef __ARBRE_BINAIRE__
#define __ARBRE_BINAIRE__
typedef char Elt;
typedef int bool;
struct znoeud {
int elt ;
char elt ;
int poids;
struct znoeud *fils_gauche;
struct znoeud *fils_droit;
@ -11,14 +12,19 @@ struct znoeud {
typedef struct znoeud noeud ;
typedef struct znoeud * arbre;
typedef struct zcode{
int lettre;
char *s;
} codage;
typedef struct zcode * code;
arbre creer_arbre_vide(void);
arbre creer_arbre_huffman(int e, int p, arbre fg, arbre fd);
arbre creer_arbre_huffman(Elt e, int p, arbre fg, arbre fd);
arbre fils_gauche(arbre a);
arbre fils_droit(arbre a);
int racine(arbre a);
bool est_arbre_vide(arbre a);
arbre creer_feuille(int e, int p) ;
arbre creer_feuille(Elt e, int p) ;
bool est_feuille(arbre a) ;
char *arbre_rechercher(arbre a, char c, char*s);
char *arbre_rechercher(arbre a, Elt c, char s[]);
#endif