Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ric(g,u,lista,visited):
- i = u.getId()
- visited.append(i)
- if int(i) % 2 == 1:
- lista.append(i)
- connections = u.getConnections()
- if connections == []: #passo base
- return
- else:
- for el in connections:
- if el not in visited:
- uu = g.getVertex(el)
- ric(g,uu,lista,visited)
- def f(g,u):
- lista = []
- visited = []
- ric(g,u,lista,visited)
- return lista
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement