| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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 |
|
#2
| |||
| |||
| 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. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.