Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- + Write an application that parses strings formatted like the below into a tree structure.
- + Format:
- 1. Top level nodes are not indented. There may be more than one top level node.
- 2. If the current line is indented one tab deeper than the previous line, it is a child of the previous node.
- 3. The indentation level of a line may never be more than 1 tab deeper than the previous line
- */
- $tree = <<<QQ
- Gardening Tools
- Pruners & Loppers
- Loppers
- Pruners
- Shovels & Cultivators
- Cultivators & Tillers
- Manual Weeders
- Shovels
- Trowels & Spades
- Size 1
- Size 2
- More tools
- Even more tools
- Other Things
- More things
- Gardening & Horticulture Books
- Flower Books
- Annuals
- Perennials
- QQ;
Add Comment
Please, Sign In to add comment