Suppose there is an N-th number of directories, each directory stores M files with unique names that do not overlap with files from other directories.
How efficient is it to put everything in the dictionary, so that by the name of the file I could get the directory where it lies, and the key + values = path to the file?
The solution to the forehead is to duplicate the path for each key, but then it turns out that the path to the same directory will be duplicated several times, which consumes RAM.