Re: Tree data structure in Java




"Allan M. Bruce" <allanmb@xxxxxxxxxxxxxxxxxxxxxx> wrote in message news:OtidnUOUuY2eXZPYRVnyrQ@xxxxxxxxxxxx
I am hoping to use a tree data structure in my Java application. I need to be able to create a tree which I can add next nodes to certain paths and obtain a list of all possible paths in the tree. Is there an implementation of this built into Java? For example, I would like to create a structure similar to this:

A1
/ \
M1 C3
/ | \ / \
D S E R Ts
/\
4 6

Basically each node is labelled with a String, I dont want the data being sorted. And I want to iterate through all paths to get a list like:

A1, M1, D
A1, M1, S
A1, M1, E
A1, C3, R, 4
A1, C3, R, 6
A1, C3, TS

If there is an existing implementation, is there any docs on how to use it?

AFAIK, there's nothing in Sun's class library like this. It should not be very difficult to implement this yourself, though.

- Oliver

.



Relevant Pages

  • Re: Buildworld failures - 6.3-PRE
    ... But AFAIK it breaks a lot of other stuff that depends on tcsh or ... tcsh-as-csh. ... Nothing in the tree depends on csh. ...
    (freebsd-current)
  • Re: Traversing VB6 menu items
    ... Can I make a tree with the same hierarchy of the menu items? ... You'll have to play with it. ... AFAIK (or perhaps more my guess? ...
    (microsoft.public.vb.general.discussion)
  • Re: [PATCH 6/6] Do not use FASTCALL for __alloc_pages_nodemask()
    ... It was a nop for some time because register parameters are always enabled ... on i386 and AFAIK no other architectures ever used it. ... Some out of tree ...
    (Linux-Kernel)
  • Re: [PATCH 6/6] Do not use FASTCALL for __alloc_pages_nodemask()
    ... choose the right calling convention? ... It was a nop for some time because register parameters are always enabled ... on i386 and AFAIK no other architectures ever used it. ... Some out of tree ...
    (Linux-Kernel)
  • Re: What is the GR precession per second?
    ... Wonder what tree is or means wondered about that it looks Healy and I ... didnt read it just looked at the title and some vcovers I dont read shit ... Dirty deeds done dirt cheap ... Keep spam illegitimate, Report spam to: ...
    (sci.physics.relativity)