Ad
  • Custom User Avatar

    It would be beneficial to specify what sort of tree traversal should be used when flattening the structure.

    Actually, the question could also become much more informative if you have a few separate functions that specify flattening via preorder, inorder, and postorder.