I realise that a binary tree is by definition a recursive data structure but I would like to do it iteratively. Well at least Insert, Search and Delete. Has anybody done this?
I did it in Pascal but I am having trouble converting the code into C.
Printable View
I realise that a binary tree is by definition a recursive data structure but I would like to do it iteratively. Well at least Insert, Search and Delete. Has anybody done this?
I did it in Pascal but I am having trouble converting the code into C.
As in
while ( p ) p = p->left;
and variations on ->left and ->right for traversing the tree.
Yes, that's it.