The .Net framework is horribly lacking a binary tree. The attached file remedies this lack. It provides the interface ISet, which defines the interface of a lookup-only container, and the classes TreeSet, which is an implementation of ISet, and TreeDictionary, which is an implementation of IDictionary (from System.Collections). It also provides the hidden class BinaryTree, which is a balanced binary search tree (AVL tree), to provide the implementation for both tree classes.
All the buzzt
CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
I can't remember. It's been a long time since I wrote this thing, and I strictly followed the theoretical approach in my university scripts. (In other words, don't expect this tree to perform ideally. AFAIK, red-black trees are better, but I don't know how to implement those.)
All the buzzt
CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.