Re: Binary search tree

Eric Bezault <[email protected]>
Newsgroups gmane.comp.lang.eiffel.gobo.devel
Message-ID <[email protected]>
Daniel Tuser wrote:
> My todo list for the binary search trees is now empty. From my point of 
> view it is ready to be released if no one finds weaknesses in the code. 

I'm currently looking at integrating your classes into
Gobo and I'm wondering whether I can make some modifications
first. For example, when I see the name of this class:
DS_ABSTRACT_COMMON_RED_BLACK_TREE, I said "Wow!". In Gobo
we try to avoid using "ABSTRACT" (all deferred classes
are abstract, so it does not give that much information
about the class). And "COMMON" does not give that much
help either. From what I can see, you have sets and tables
implemented with various binary search tree algorithms.
In Gobo we already have DS_SPARSE_CONTAINER with the
descendants DS_SPARSE_TABLE and DS_SPARSE_SET. I think
that's what you tried to do with your "COMMON" classes.
So instead of DS_COMMON_BINARY_SEARCH_TREE I suggest
DS_BINARY_SEARCH_TREE_CONTAINER, with the indexing
clause: "Containers using binary search tree algorithms".
Then you have two descendants: the set version
DS_BINARY_SEARCH_TREE_SET and the table version
DS_BINARY_SEARCH_TREE (for which we don't put the suffix
_TABLE because this container is commonly known without it).
And use the same naming convention for all binary search
tree algorithms. Now, trying to get rid of "ABSTRACT", I
wonder why we cannot have DS_LEFT_LEANING_RED_BLACK_TREE
that inherits from DS_RED_BLACK_TREE (instead of having
this "ABSTRACT" common ancestor). If this is OK, I can
do the renaming as well as making sure that the header
comments follow the Eiffel style guidelines while integrating
the classes in Gobo.

-- 
Eric Bezault
mailto:[email protected]
http://www.gobosoft.com

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.