Hi,
I have completed the updates proposed in the last discussion on trees. The
tree node code now contains:
TreeNode - a simple list based tree node interface
ArrayTreeNode - an implementation based on ArrayList
TreeUtils - a group of useful utilities for managing trees
TestArrayTreeNode - a test
:[EMAIL PROTECTED]]
Sent: Monday, May 27, 2002 11:19 AM
To: Jakarta Commons Developers List
Subject: Re: [Collections][Submit] TreeNode and friends
From: Kief Morris [EMAIL PROTECTED]
I would rather keep the iterator on TreeNode. If there are only two
standard
ways to iterate then two
of?
Stephen
-Paul
-Original Message-
From: Stephen Colebourne [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 27, 2002 11:19 AM
To: Jakarta Commons Developers List
Subject: Re: [Collections][Submit] TreeNode and friends
From: Kief Morris [EMAIL PROTECTED]
I would rather keep
Stephen Colebourne typed the following on 07:48 PM 5/26/2002 +0100
4. Must tree iterators be depth-first? The ordered
traversal for a heap tree isn't depth-first.
No, but depth first is the one I needed ;-) There are two possibilities
here,
a) Add extra methods for different
From: Kief Morris [EMAIL PROTECTED]
I would rather keep the iterator on TreeNode. If there are only two
standard
ways to iterate then two methods would seem appropriate. But are there
more
than two ways??
I favor a single iterator() method on the interface which returns the
nodes in an
3. What's the rationale for having equals and hashCode
be reference based?
The alternative is to compare both the value and children of that node. But
in comparing the children, each child node will compare its value and
children and so on. This would be potentially very expensive. Its
From: bob mcwhirter [EMAIL PROTECTED]
3. What's the rationale for having equals and hashCode
be reference based?
The alternative is to compare both the value and children of that node.
But
in comparing the children, each child node will compare its value and
children and so on.
Some Feedback:
TreeNode:
1. Should it extend Cloneable? Some trees might not be
able to be Cloneable effectively (for instance, a Btree
backed by a file).
2. I think we should allow setValue to throw an
UnsupportedOperationException for unmodifiable trees.
3. What's the rationale for
The following link contains a submission to collections of classes to cover
trees:
http://www.scolebourne.eurobell.co.uk/TreeNode.zip
This was discussed earlier in the year, but failed to come to a conclusion
due to other commitments of Kief Morris at that time. I have now implemented
an API for
The following link contains a submission to collections of classes to cover
trees:
http://www.scolebourne.eurobell.co.uk/TreeNode.zip
This was discussed earlier in the year, but failed to come to a conclusion
due to other commitments of Kief Morris at that time. I have now implemented
an API for
10 matches
Mail list logo