Skip to content

Commit

Permalink
fix the example so that all leaves are regular files
Browse files Browse the repository at this point in the history
also fix typo
  • Loading branch information
vladak committed May 19, 2024
1 parent 432405b commit cb5c0ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/home-assignments/dirtree.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
## Create and traverse path tree

In memory, build a tree of paths, where each node is a path element. The tree
starts with root '/', the non-leaf nodes are directories, the leaves are files.
The three can look e.g. like this:
starts with root `/` (assuming Unix-like system), the non-leaf nodes are directories, the leaves are regular files.
The tree can look e.g. like this for paths `/foo/a.c`, `/foo/b.c`, `/f.txt`, `/bar/c.c`:

```
"/"
/ | \
/ | \
"foo/" "f.txt" "bar/"
/ \
"a.c" "b.c"
/ \ |
"a.c" "b.c" "c.c"
```

Populate the tree with given paths and print the leaves (no particular order),
Expand Down

0 comments on commit cb5c0ae

Please sign in to comment.