#ifndef HASH_TABLE_H
#define HASH_TABLE_H

#include "hhentry.h"

typedef struct _TreeNode TreeNode;

struct _TreeNode{
  TreeNode *left;
  TreeNode *right;
  HHItem *data;
};

typedef struct _Tree {
  TreeNode *root;
} Tree;

#if 0
typedef struct _HashTable {
  int n_items;
  HHEntry **list;
}HashTable;
#endif

TreeNode *
tree_search_hangul (Tree *tree, unsigned char *hangul);

Tree *
tree_n_new (int n);

TreeNode *
tree_node_new_with_hhitem (HHItem *data);

void
tree_insert (Tree *tree, TreeNode *tnode);

void
tree_clear (Tree *tree);

#endif /* HASH_TABLE_H */
#ifndef HASH_TABLE_H
#define HASH_TABLE_H

#include "hhentry.h"

typedef struct _TreeNode TreeNode;

struct _TreeNode{
  TreeNode *left;
  TreeNode *right;
  HHItem *data;
};

typedef struct _Tree {
  TreeNode *root;
} Tree;

#if 0
typedef struct _HashTable {
  int n_items;
  HHEntry **list;
}HashTable;
#endif

TreeNode *
tree_search_hangul (Tree *tree, unsigned char *hangul);

#endif /* HASH_TABLE_H */
