Replaces all tree nodes with their unique ordinal. The order is depth-first
post-order, so that the root node value is the maximum. For example a tree
shaped so:
┬? ├─? └┬? ├─? └─?
Will become this tree:
┬5 ├─1 └┬4 ├─2 └─3
Under the pre key you will find a version that does the same but in
depth-first pre-order, and under the breadthFirst key you will find a version
that does the same but in breadth-first order.
Replaces all tree nodes with their unique ordinal. The order is depth-first post-order, so that the root node value is the maximum. For example a tree shaped so:
Will become this tree:
Under the
prekey you will find a version that does the same but in depth-first pre-order, and under thebreadthFirstkey you will find a version that does the same but in breadth-first order.