On Fri, 4 Jul 2003 16:30:01 -0700
"Steven T. Hatton"
I have to confess, without the ability to do some kind of recursion, I don't see where I would have much use for such a library. It looks as though there may be a solution. I am just now looking this over. This looks like a fantastic course:
http://www.cs.uiowa.edu/~rlawrenc/teaching/030/Notes/
My implementation did not have iterators, and I'm not sure how I would implement an iterator in a binary tree.
I guess one could do some kind of infix, prefix or postfix traversal, or simply iterate over the children. In the case of a binary tree, that doesn't make a lot of sense. In the case of an N-ary(sic) tree, that may make more sense. My implementation is fully recursive including both an preorder and inorder traversal. I just did not implement some of the generic algrithms and iterators. Generally, the STL contains most of the tools you need. While I don't have Rogue Wave, they have all sorts of good types, including binary trees.
The problem with the standard STL types is that they don't handle
searches well, but a balanced binary tree handles insertions and
searches very efficiently. (The down side is that if you do not have
some kind of balancing algorithm, your tree could end up as a linked
list).
--
Jerry Feldman