I have a collection of string paths like [\"x1/x2/x3\",\"x1/x2/x4\",\"x1/x5\"] in a list. I need to construct a tree-like structure from this list which can be iterated to g
I'd make the tree one string at a time.
Make an empty tree (which has a root node - I assume there could be a path like "x7/x8/x9").
Take the first string, add x1 to the root node, then x2 to x1, then x3 to x2.
Take the second string, see that x1 and x2 are already there, add x4 to x2.
Do this for every path you have.