You are not logged in. Please login at www.codechef.com to post your questions!

×

Strongly connected component!

I have written the code for kosaraju's algorithm for finding the scc, Its giving wrong answer for this graph:-
alt text

here's the code:- http://ideone.com/3uxMdo Whats wrong in the code?

asked 21 May '14, 17:57

v_akshay's gravatar image

4★v_akshay
1.2k91625
accept rate: 13%

edited 21 May '14, 17:58


Although, it is quite a long time after you asked. The mistake is that on line 59 it should have been !used[order[i]] instead !used[i] (since you do not want to check whether the index was used, but rather the node).

link

answered 31 Oct '15, 07:12

dim131's gravatar image

0★dim131
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,217
×366
×36
×3

question asked: 21 May '14, 17:57

question was seen: 3,236 times

last updated: 31 Oct '15, 07:12