Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • \$\begingroup\$ This is irrelevant to the challenge, but I think T_0 is technically not a tree but only a forest. In my opinion a tree should have exactly one connected component. However, T_0 does satisfy the definition of tree given on wikipedia: "for every pair of vertices there is a unique path between them". This is vacuously satisfied by the empty graph. \$\endgroup\$ Commented Feb 4, 2021 at 23:18
  • 1
    \$\begingroup\$ @Hood True, and actually my definition of Fibonacci trees doesn't work for T0 because a tree height of -1 doesn't make much sense. It merely serves as a base case to correctly define T2 and beyond. \$\endgroup\$ Commented Feb 4, 2021 at 23:31
  • \$\begingroup\$ In the nested array representation is an empty array, an empty tree or a node with no children? And either way how is the opposite one represented? (I ask because in my experience usually the nested array representation is taken to represent rooted trees, which do not include the empty tree). \$\endgroup\$ Commented Feb 5, 2021 at 12:10
  • 1
    \$\begingroup\$ @WheatWizard Honestly I didn't think of consequences of the empty graph. But for example, you can represent the empty graph as [], and then the single-node graph becomes [[],[]]. Or you can wrap the entire graph in an Option type, etc. \$\endgroup\$ Commented Feb 5, 2021 at 23:12