TIP: Click on subject to list as thread! ANSI
echo: public_domain
to: All
from: Paul Edwards
date: 1995-11-10 01:10:50
subject: btree.h

/******************************************************************************/
/*                                                                            */
/*  Name:        btree.h                                                      */
/*                                                                            */
/*  Written by: David Galbraith                                               */
/*                                                                            */
/*  Date:         October 1995                                                */
/*                                                                            */
/*----------------------------------------------------------------------------*/
/*                                                                            */
/*  This code is hereby released to the public domain.  You may use and/or    */
/*  modify it in any way you choose without restriction.                      */
/*                                                                            */
/******************************************************************************/

#ifndef __BTREE_H
#define __BTREE_H
#endif

/* binary tree structure declarations */

struct btnode {
        void *data;
        struct btnode *left;
        struct btnode *right;
};

typedef struct btnode TNode;

typedef struct btnode *TNodePtr;

typedef int (*CompareFunction) (void *, void*);

typedef void (*NodeFunction) (void *);

void tFree(TNodePtr *proot);

int tInsert(TNodePtr *proot, void *data, CompareFunction tcf);

void *tDelete(TNodePtr *proot, void *data, CompareFunction tcf);

void *tSearch(TNodePtr *proot, void *data, CompareFunction tcf);

void tTraverse(TNodePtr *proot, NodeFunction tnf);

void tDisplay(TNodePtr *proot, NodeFunction tnf);
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.