I have made a Bintree, where I sort numbers.

It can fx be phonenumbers.

But how do I delete on in the memorystack,

fx if a numbers is is in the stack and the number is drawn again It has to delete it self, or actually the numbers has to be deleted from the tree.

code snip---------------

typedef struct TreeCell *Treeptr;

struct TreeCell

{

double number;

Treeptr left, right;

};

// function made.. talloc..!!

Treeptr talloc(void)

{

return (Treeptr) malloc (sizeof(struct TreeCell));

}

Treeptr AddCell(Treeptr p, double number)

{

if(p == NULL)

{

p = talloc();

p->number = number;

p->right = p->left = NULL;

}

else

{

if(number == p->number)

{

FUNCTIONCALL (has to delete the number..????)

}

else

{

if(number < p->number)

p->left = AddCell(p->left, number);

else

p->right = AddCell(p->right, number);

}

}

return p;

}

The problem is to delete a number in the stack.

A lot of rearranging has to be done...

Tx hoping to get some help..

tx

!G!