Home | Trees | Indices | Help |
---|
|
1 from bisect import * 510 """Returns parents of nodes that meed a given condition""" 11 ret = [] 12 queue = [root] 13 while queue: 14 current = queue.pop() 15 children = eval('current'+childrenstr) 16 for child in children: 17 if eval('child'+conditionstr): 18 ret.append(current) 19 #we know have a tree, so there are no back-edges etc, so no checking of that kind is 20 #necessary 21 queue += children 22 return ret23
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Feb 18 16:55:27 2011 | http://epydoc.sourceforge.net |