Back to problems

Filesystem Navigation

Object-Oriented Programming · Uber · Medium

Directory Tree with Memoized Wildcard Resolution A directory can be represented as a stable node containing its name, its parent, and a map of child names to child nodes. The file system keeps a pointer to the current node, so changing directories does not require rebuilding any path strings. This implementation uses the following rules: / begins an absolute path; every other path is relative to the current directory. Repeated slashes are ignored. . keeps the resolver at the…

Checking your access…