Day 24: Crossed Wires
Part A
Let $T=(V,E)$ be a tree.
Algorithm:
- let $x\leftarrow$ depth-first search of $T$;
- return $x$.
Time complexity: $O(\lvert V\rvert)$.
Space complexity: $O(\lvert V\rvert)$.
Let $T=(V,E)$ be a tree.
Algorithm:
Time complexity: $O(\lvert V\rvert)$.
Space complexity: $O(\lvert V\rvert)$.