Re: Binary search tree

Eric Bezault <[email protected]> Sun, 20 Jul 2008 21:46:02 +0200
Newsgroups gmane.comp.lang.eiffel.gobo.devel
Message-ID <[email protected]>
Hi Daniel,

Your binary search tree classes are now committed to SVN in
the SourceForge Gobo project. As agreed, I made some name
changes and some header comments and reformatting to better
match Gobo's style guildelines. I also removed the unnecessary
`void_is_valid_key' and merged `equality_tester' with `comparator'.
I probably did some other minor changes, such as making sure
that "key" features are not exported in the set classes
(set classes don't have the notion of keys in their interface).

I didn't review the binary search tree algorithms. But I think
that some improvements can be made. For example, would it be
possible to redefine `cursor_search_forth' and `cursor_search_back'
in DS_BINARY_SEARCH_TREE_SET, to take advantage that the items
are sorted, and hence avoid linear traversal?

Also, I think that `internal_put' and `internal_put_new' deserve
some postconditions that should match those of DS_SET and DS_TABLE
so that when they are used to implement the corresponding features
in set and table variants the code is correct in terms of DbC.

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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/