Advertisement
goader

zad6

Apr 8th, 2020
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. def DFSVisit(x, y, value):
  2.     if (x == y): return True
  3.     for neighbs in range(len(x.neighbours)):
  4.         if (x.neighbours_value[neighbs] < value and x.neighbours_vis[neighbs] == False):
  5.            res = DFSVisit(x.neighbours[neighbs], y, x.neighbours_value[neighbs])
  6.            if not res:
  7.                x.neighbours_vis[neighbs] = True
  8.            else:
  9.                print(x.number)
  10.                return res
  11.     return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement