treeh.h
583 Bytes
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
#ifndef TREEH_H
#define TREEH_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#define NBCHAR 27 //A-Z + '
typedef struct _node node, *tree;
struct node{
char letter;
bool isEnd;
node* next[NBCHAR];
};
tree make_empty_tree();
node* make_empty_node();
node* make_node(char,bool);
void delete_tree(tree);
bool is_empty(tree);
bool is_end(tree);
bool is_followed(tree);//tells if tree has following letters
void addto_tree(tree,char*,int);
void loadfrom_file(tree,FILE*);
void loadfrom_keyboard(tree);
int hash(char);
#endif //TREEH_H