Skip to content
Advertisement

Tag: hierarchy

Create child nodes using recursion

I’m trying to create a hierarchy from flat data. I have the following Node definition: Given this data: [Person,Manager,Hourly,New], where the tree should be like: I’ve tried the following: And my createNode method is: But conceptually I don’t understand how to maintain the structure if Java is return-by-value. What do I add to createNode so that I can add a

Advertisement