Skip to content
Snippets Groups Projects
Commit 740e51da authored by Jacob Wahlman's avatar Jacob Wahlman :ok_hand:
Browse files

pylint on utilities

parent 9fed5ea4
No related branches found
No related tags found
1 merge request!7Resolve "Operation Traversing"
Pipeline #10182 passed
"""@package docstring
B-ASIC Operation Module.
TODO: More info.
"""
from typing import List
from collections import deque
from b_asic.operation import Operation
def breadth_first_search(start: Operation) -> List[Operation]:
"""Use breadth first search to traverse the operation tree."""
visited: List[Operation] = [start]
queue = deque([start])
while queue:
operation = queue.popleft()
yield operation
for n_operation in operation.neighbours:
if n_operation not in visited:
visited.append(n_operation)
queue.append(n_operation)
"""Use breadth first search to traverse the operation tree."""
visited: List[Operation] = [start]
queue = deque([start])
while queue:
operation = queue.popleft()
yield operation
for n_operation in operation.neighbours:
if n_operation not in visited:
visited.append(n_operation)
queue.append(n_operation)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment