How can I use the iteration mechanism to iterate through a tree?
Is CURSOR_TREE_ITERATOR the right class?
The following does not compile because iterator expects the type
CURSOR_TREE [BINARY_SEARCH_TREE [INTEGER_32]].
class
APPLICATION
create
make
feature -- Initialization
make is
-- Run application.
local
tree: BINARY_SEARCH_TREE [INTEGER]
iterator: CURSOR_TREE_ITERATOR BINARY_SEARCH_TREE [INTEGER]]
do
create tree.make (500)
tree.put (400)
tree.put (600)
create iterator
iterator.set (tree)
end
end -- class APPLICATION
There must be a simple solution without requiring the client programmer
to build his own class inheriting from the deferred class CURSOR_TREE,
isn't it?
Thx