def dfs_postorder(b, seen):
 order = []
 seen[b] = b
 for c in b.get_children():
  if seen.has_key(c):
   continue
  order = (order + dfs_postorder(c, seen))
 order.append(b)
 return order

def dfs_postorder ( b , seen ) : order = [ ] seen [ b ] = b for c in b . get_children ( ) : if seen . has_key ( c ) : continue order = ( order + dfs_postorder ( c , seen ) ) order . append ( b ) return order
depth-first search of tree rooted at b .