📅  最后修改于: 2022-03-11 14:46:55.186000             🧑  作者: Mango
def dft(self, array):
stack = Stack()
visited = set()
stack.append(self)
while len(stack) > 0 and while len(visited) >= 0:
current = stack.pop()
array.append(current)
visited.add(current)
return array