Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def afs(g, s):
- bag = data_structure()
- bag.add(s)
- while bag is not empty:
- tile = bag.pop()
- if tile is not marked:
- mark(tile)
- for x in adj_list(tile):
- bag.add(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement