Object-Oriented Programming · Harvey · Medium
Trie of Path Components A file system is a tree by nature: each directory is a node, and the names one level deeper are that node's children. Modeling it this way — one node per path component instead of one string per full path — makes the "parent must already exist" rule emerge directly from the walk down the tree. Each node keeps a map from child name to child node, plus a flag recording whether a value was ever attached at that location. The root always exists but is…
Checking your access…