SHARE
TWEET

Asd-Esercizio3-giugno2019

a guest Nov 12th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Algo(G)
  2.  
  3.     INIT(G)
  4.     ORD_TOPOLOGICO(G)
  5.     numsem=0
  6.     maxsem=0
  7.     ret=dfs_mod(G,v,numsem)
  8.  
  9. return ret
  10.  
  11. dfs_mod(G,s,numsem)
  12.     c[s]=g
  13.     for each u in Adj[s] do
  14.         if c[u]=b then
  15.             numsem++
  16.             if numsem > maxsem then
  17.                 maxsem=numsem
  18.             dfs_mod(G,u,numsem)
  19.     c[s]=n
  20. return maxsem
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top