-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstructure.h
72 lines (44 loc) · 1.01 KB
/
structure.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include<stdlib.h>
#include<stdio.h>
#include <math.h>
#include <string.h>
typedef struct node_tree nTree;
struct node_tree{
int occ;
char* letter;
nTree* nLeft;
nTree* nRight;
nTree* nFather;
};
typedef struct node_list nLink;
struct node_list{
nTree* node;
nLink* next;
};
typedef struct list list;
struct list{
int length;
nLink* head;
};
int search_in_char(char*,char*);
nTree* create_node_tree(int,char);
list* list_of_node(char*);
nLink* fusion(nLink*,nLink*);
list* chain_fusion(list*);
char* code_char(nTree*,char*);
char* chain_code(nTree*,char*);
char* decode_char(nTree*,char*);
char* chain_decode(nTree*,char*);
int occurence(char*,char*);
nLink* create_link(nTree*);
void add_link(nLink*,nLink*);
list* create_list();
void add_to_list(list*,nLink*);
int is_in_list(list,char*);
void tri_list(list*);
void destroy_tree(nTree*);
void destroy_all_link(nLink*);
void destroy_list(list*);
char* print_all_link(list*);
void printDualTree(nTree*,int);
char* print_node_tree(nTree*);