Related to my question about how to build a tree-like structure, the data I receive from the server are in arrays like this: {School Chair Table Chalk}
How can I loop through this so that:
- School becomes parent of Chair
- Chair becomes parent of Table
- Table becomes parent of Chalk