A file system is represented as a tree with two node types: - DirectoryNode: has children (mix of DirectoryNode and FileNode) - FileNode: has an is_encrypted boolean attribute Part 1: Implement a function that, given a root DirectoryNode, recursively traverses the entire subtree and returns (encrypted_count, unencrypted_count). Part 2: Given…