Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(VAL[u] % 2 == 1)
- return false;
- for each v€V do
- c[v] = bianco
- count[v] = 0
- for each v€V do
- if(c[v] == bianco)
- DFS_Visit(G, s, VAL, count)
- for each v€V do
- if(count[v] > 1 && (VAL[v] % 2 == 1)) then
- return false;
- else if (count[v] <= 1 && (VAL[v] % 2 == 0) ten
- return false;
- return true;
- -------------------------------------------
- DFS_Visit(G, s, VAL, count)
- c[s] = grigio
- for each t€Adj[s] do
- if(c[t] == bianco) then
- DFS_Visit(G, t, VAL, count)
- else if (c[t] == grigio)
- count[t]++;
- count[s]++;
- c[s] = nero
- count[s]++
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement