+ As Ken Shan points out, this is an instance of the algorithm
+ for converting name/year citations (like 'see Montague 1970')
+ to numerals corresponding to their position in the
+ bibliography ('see [24]'). Except that bibliographic numerals
+ don't start with zero.
+
+ Give some thought to efficiency: there are straightforward
+ solutions that involve traversing the tree once (in order to,
+ say, construct a suitable mapping from leafs to ints), then
+ traversing it again to do the conversion. Can you find a
+ solution that traverses the tree exactly once, replacing each
+ leaf as soon as you see it?
+
+ You can assume that the tree is binary, leaf-labeled (no
+ labels on the internal nodes), and that the leafs are, say,
+ chars.
+
+ Here is [a hint](/hints/assignment_10_hint_1).
+
+ Consider a variation in which you must replace each leaf with
+ its number of occurrences in the tree. Is there any way to do
+ that with a single traversal? (Here is [a hint](/hints/assignment_10_hint_2).)
+