36/38
Part 7 of 7 · Follow-upsLearn

The tests you'd write cover one node, a long chain, a star and the awkward inputs

  • One node.
  • A chain longer than 1,000, listed top first and listed bottom first.
  • A star, one node over thousands.
  • The top's row not first.
  • Leaves with no row of their own.
  • The smallest common ancestor of a node and itself, of a node and its own descendant, and of two nodes at different depths.
  • A value set twice.
  • A change at the top.