cancel
Showing results for 
Search instead for 
Did you mean: 

representing hierarchical data in java

Former Member
0 Kudos

hi all,

i am faced with the problem of representing hierarchical data like an ORGANIIZATION STRUCTURE in my java program.

the structure primarily consists of 3 kind of objects

org. units, managers, other employees.

can u suggest the best data structures to represent such data.Is a n-ary tree advisable here.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi singh,

A Hierarchical Data Structure can be conceptually represented as a Java API, or XML, or some other format. It is easiest to visualize as XML.

hello sir, i'll send you one article link just go thru it , you can see examples also. i can suggest tree is the best one because tree grows in random tree generator fashion and traverse a directory structure. Reward points if its helpfull , Thanks

http://www.onjava.com/pub/a/onjava/2003/03/05/hds.html

Regards,

Varun Jain

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

A tree structure will be more useful to represent hierarchical data .

You can represent such data as an xml tree structure. Refer <a href="http://www.ibiblio.org/xml/books/xmljava/chapters/ch04s05.html">here</a> to get an example of converting flat file to a xml document.

Using JTree API you can store and process the data as tree structure. Click <a href="http://java.sun.com/developer/TechTips/2000/tt0209.html">here</a> for more information and example.

Regards,

Uma