HashMaps and parent/child relationships
Posted on 2002-04-30
I need to create a parent to child relationship of my records and would like to use hashmaps to store the data and then a TreeSet/Iterator to get the ordered value
The records are as follows and come in random order:
Record 1: Parent 1; Child 2
Record 2: Parent 2; Child 1
Record 3: Parent 1; Child 1
Record 4: Parent 3; Child 1
The output i'm trying to accomplish is:
I can easily fill the hash maps but can't figure out how to relate the children.
Thanks in advance. Let me know if more clarification is needed.