Jump to content

Tarjan: Difference between revisions

m
m (→‎{{header|Racket}}: Whoops. Fixed the typo)
Line 489:
 
=={{header|Racket}}==
 
=== Manual implementation ===
 
{{trans|Kotlin}}
Line 559 ⟶ 561:
<pre>
'((7) (3 4) (5 6) (2 1 0))
</pre>
 
=== With the graph library ===
 
<lang racket>#lang racket
 
(require graph)
 
(define g (unweighted-graph/adj '([0 1]
[2 0]
[5 2 6]
[6 5]
[1 2]
[3 1 2 4]
[4 5 3]
[7 4 7 6])))
 
(scc g)</lang>
 
{{out}}
<pre>
'((7) (3 4) (5 6) (1 0 2))
</pre>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.