Blame view

treeh.h 410 Bytes
a4ef278c   bjeanlou   init withHash
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
  #ifndef TREEH_H
  #define TREEH_H
  
  #include <stdlib.h>
  #include <stdio.h>
  #include <string.h>
  
  #define NBCHAR 27 //a-z + '
  
  
  typedef
  struct node{
    char letter;
    char isEnd;
    node* next[NBCHAR]
  } *ptNode,*tree;
  
  tree make_empty_tree();
  
  void addto_tree(tree,char*,int);
  void loadfrom_file(tree,FILE*);
  void loadfrom_keyboard(tree);
  
  char is_empty(tree);
  char is_end(tree);
  
  int hash(char);
  
  
  
  #endif //TREEH_H