Skip to content

Instantly share code, notes, and snippets.

@kunigami
Last active November 10, 2019 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunigami/1f83f074178b7f4ed0e223af1134b7bb to your computer and use it in GitHub Desktop.
Save kunigami/1f83f074178b7f4ed0e223af1134b7bb to your computer and use it in GitHub Desktop.
queue = [root]
while queue is not empty:
r = queue.pop()
for each c in r.children():
output(s) = output(ps(s))
if (s is match):
output(s).add(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment