Guest User

Untitled

a guest
Apr 25th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. /*
  2. + Write an application that parses strings formatted like the below into a tree structure.
  3. + Format:
  4. 1. Top level nodes are not indented. There may be more than one top level node.
  5. 2. If the current line is indented one tab deeper than the previous line, it is a child of the previous node.
  6. 3. The indentation level of a line may never be more than 1 tab deeper than the previous line
  7. */
  8.  
  9. $tree = <<<QQ
  10. Gardening Tools
  11. Pruners & Loppers
  12. Loppers
  13. Pruners
  14. Shovels & Cultivators
  15. Cultivators & Tillers
  16. Manual Weeders
  17. Shovels
  18. Trowels & Spades
  19. Size 1
  20. Size 2
  21. More tools
  22. Even more tools
  23. Other Things
  24. More things
  25. Gardening & Horticulture Books
  26. Flower Books
  27. Annuals
  28. Perennials
  29. QQ;
Add Comment
Please, Sign In to add comment