This question evaluates skills in data structure and API design for mutable rooted trees, including node representation, parent/children management, iterator implementation (DFS/BFS), serialization/deserialization, cycle-safety, and time-complexity reasoning within the Coding & Algorithms domain.
Design and implement a Node class for a mutable rooted tree. Requirements: store value, parent, and ordered children; support add_child, remove, move_subtree, and replace_child in O(