BINARY_SEARCH_TREE

This is a discussion on BINARY_SEARCH_TREE within the Eiffel forums in Programming Languages category; In class BINARY_SEARCH_TREE there is no "do_all" routine which can be invoked with an agent as in class LINKED_LIST. One has to redefine routine "node_action" in a descendant of BINARY_SEARCH_TREE. But what if one needs more than one traversal routine. Is class BINARY_SEARCH_TREE not intended for direct use? But then it were a deferred class. How can you find out the root node of BINARY_SEARCH_TREE? Thx...

Go Back   Application Development Forum > Programming Languages > Eiffel

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 10-19-2007, 12:43 PM
=?ISO-8859-1?Q?Roman_T=F6ngi?=
Guest
 
Default BINARY_SEARCH_TREE

In class BINARY_SEARCH_TREE there is no "do_all"
routine which can be invoked with an agent as in
class LINKED_LIST.

One has to redefine routine "node_action" in a
descendant of BINARY_SEARCH_TREE. But what if
one needs more than one traversal routine.

Is class BINARY_SEARCH_TREE not intended for direct
use? But then it were a deferred class.

How can you find out the root node of BINARY_SEARCH_TREE?

Thx
Reply With Quote
  #2  
Old 10-20-2007, 05:12 AM
Friedrich Dominicus
Guest
 
Default Re: BINARY_SEARCH_TREE

Roman Töngi <roman.toengi@hispeed.ch> writes:

> In class BINARY_SEARCH_TREE there is no "do_all"
> routine which can be invoked with an agent as in
> class LINKED_LIST.

Yes you are are right. What you can do is
call to_linear or the like and there you can use the agents.
>
> One has to redefine routine "node_action" in a
> descendant of BINARY_SEARCH_TREE. But what if
> one needs more than one traversal routine.

Then you have to have different descendants....
>
> Is class BINARY_SEARCH_TREE not intended for direct
> use? But then it were a deferred class.

Well node_action has not implementation, but you can use all the rest.


Regards
Friedrich

--
Please remove just-for-news- to reply via e-mail.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 05:14 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.