📜  def dft(self, array): stack = Stack()visited = set() stack.append(self) while len(stack) > 0 and while len(visited) >= 0: current = stack.pop() 数组. append(current)visited.add(current) 返回数组 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:55.186000             🧑  作者: Mango

代码示例1
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