Last time: Started 6.3 | Next time: section 6.4 |
If you treated the tree as binary, and permitted a tree to have a right child without a left (in contrast to our author's algorithm), then the inorder traversal produced a sorted list.
If you follow the author's convention that single children are left children, then the result would be "Beloved Best Elephant far had and high In no O off the trunk times."
We should have only 4 leaves, however: we only care which coin is counterfeit, not whether it is heavy or light.
It doesn't pay to compare one pair to another: we know that they'll be unbalanced, but we won't be able to tell from that which pair has the counterfeit coin in it!
In this problem one trick was that you didn't need to know whether the coin was heavy or light. That cuts the number of leaves in half....