• Post Reply Bookmark Topic Watch Topic
  • New Topic

tree collection  RSS feed

 
Dan Murphy
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to use a tree structure to represent a series of operators and operators, e.g. 4 + 2 + 1 + 1 + 3

The operators (+) would appear as parent nodes and the operands as leaf nodes. Ideally, I'd like to able to add operands to the tree and the relevant operators will automatically be added. So if I have a tree that contains just a single node (4), then call tree.append(3), the class will automatically create a root node (+) which had two children (4, 3).

I've had a look in the Java API, but haven't found anything that would fit my needs, any suggestions?

Cheers,
DM
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!