code: def annotateTree(bT, fn):
      
      l = [None]*bT.traversalID.midEnd
      def fn2(bT):
          l[bT.traversalID.mid] = fn(bT)
          if bT.internal:
              fn2(bT.left)
              fn2(bT.right)
      fn2(bT)
      return l
docs: annotate a tree in an external array using the given function