Jump to content

Talk:Stoer–Wagner algorithm

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 72.35.36.236 (talk) at 14:09, 12 April 2016 (I don't think the 2nd sample implementation is correct.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

This article contains two sample implementations. The first one is C++, contains a reference, and appears to work.

I can't get the second one to work. First, I can't tell for sure what language it is. It mostly looks like C, but the code uses C++ reference syntax in one place:

int contract( int &s, int &t )

Even after changing the references to pointers, I couldn't get a sensible answer.

Finally, will memset(bin, false, sizeof(bin)); clear the entire array, or is

   memset(bin, false, sizeof(bool)*maxn);

correct?