This question evaluates understanding of tree traversal and depth-first search along with competence in handling hierarchical data structures and constructing full file paths.
You are given an in-memory representation of a file system as a tree.
Each node has:
name
(string)
isFile
(boolean)
children
(list of nodes, empty for files)
The root node represents the root directory (e.g., name "/" or "root").
Write a function that returns all full paths to files in the file system. Paths should be constructed by joining directory names with /.
Notes:
Example:
Output could be:
root/a/b.txt
root/a/c/d.md
root/e.log
Implement the function using DFS.