File: bintree.h

package info (click to toggle)
abiword 0.7.7-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 20,604 kB
  • ctags: 18,358
  • sloc: cpp: 88,791; ansic: 66,296; sh: 7,777; makefile: 3,397; xml: 687; perl: 361; awk: 273; sed: 36; csh: 28
file content (31 lines) | stat: -rw-r--r-- 737 bytes parent folder | download
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 BinTree
#define BinTree
/* Caolan.McNamara@ul.ie */

/* modify these lines to establish data type */

typedef struct Node_ 
	{
    struct Node_ *Left;         /* left child */
    struct Node_ *Right;        /* right child */
    struct Node_ *Parent;       /* parent */
    void *Data;                     /* data stored in node */
	} Node;



typedef struct BintreeInfo_ 
	{
	Node *Root;
	int (*CompLT)(void *,void *); 
	int (*CompEQ)(void *,void *);
	int no_in_tree;
	} BintreeInfo;


void InitBintree(BintreeInfo *,int (*)(void *,void *),int (*)(void *,void *));
Node *InsertNode(BintreeInfo *,void *);
void DeleteNode(BintreeInfo *,Node *);
Node *FindNode(BintreeInfo *,void *);
Node *NextNode(BintreeInfo *,Node *);
#endif