Click here to Skip to main content
15,889,116 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralFloyd's Cycle Detection (Linked List) Pin
User 238229224-Feb-08 6:45
User 238229224-Feb-08 6:45 
GeneralRe: Floyd's Cycle Detection (Linked List) Pin
User 238229227-Feb-08 2:43
User 238229227-Feb-08 2:43 
GeneralRe: Floyd's Cycle Detection (Linked List) Pin
Alan Balkany28-Feb-08 4:52
Alan Balkany28-Feb-08 4:52 
GeneralRe: Floyd's Cycle Detection (Linked List) Pin
Luc Pattyn29-Feb-08 10:40
sitebuilderLuc Pattyn29-Feb-08 10:40 
GeneralRe: Floyd's Cycle Detection (Linked List) Pin
Alan Balkany29-Feb-08 10:44
Alan Balkany29-Feb-08 10:44 
GeneralRe: Floyd's Cycle Detection (Linked List) Pin
Luc Pattyn29-Feb-08 10:54
sitebuilderLuc Pattyn29-Feb-08 10:54 
GeneralRe: Floyd's Cycle Detection (Linked List) Pin
User 238229229-Feb-08 20:25
User 238229229-Feb-08 20:25 
GeneralRe: Floyd's Cycle Detection (Linked List) Pin
Luc Pattyn1-Mar-08 0:43
sitebuilderLuc Pattyn1-Mar-08 0:43 
st0le wrote:
if we want to reinitialize the boolean (to false),we'll need to traverse the list


if you need it more than once, use one of the following:
1. a collection that allows you to iterate all the nodes without following the normal links;
2. a generation number that increments every time you start a cycle test; it gets initialized
only once (at node creation time), and it gets compared and stored during a cycle test.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.


GeneralMaths Homework - My boys (not mine - honest!!) [modified] Pin
Malcolm Smart24-Feb-08 2:18
Malcolm Smart24-Feb-08 2:18 
GeneralRe: Maths Homework - My boys (not mine - honest!!) Pin
Giorgi Dalakishvili24-Feb-08 3:48
mentorGiorgi Dalakishvili24-Feb-08 3:48 
GeneralRe: Maths Homework - My boys (not mine - honest!!) Pin
Luc Pattyn24-Feb-08 4:58
sitebuilderLuc Pattyn24-Feb-08 4:58 
GeneralRe: Maths Homework - My boys (not mine - honest!!) Pin
Malcolm Smart24-Feb-08 5:34
Malcolm Smart24-Feb-08 5:34 
GeneralRe: Maths Homework - My boys (not mine - honest!!) Pin
Luc Pattyn24-Feb-08 5:45
sitebuilderLuc Pattyn24-Feb-08 5:45 
GeneralRe: Maths Homework - My boys (not mine - honest!!) Pin
Malcolm Smart24-Feb-08 6:49
Malcolm Smart24-Feb-08 6:49 
GeneralRe: Maths Homework - My boys (not mine - honest!!) Pin
Luc Pattyn24-Feb-08 6:52
sitebuilderLuc Pattyn24-Feb-08 6:52 
GeneralRe: Maths Homework - My boys (not mine - honest!!) Pin
Malcolm Smart24-Feb-08 7:07
Malcolm Smart24-Feb-08 7:07 
GeneralRe: Maths Homework - My boys (not mine - honest!!) Pin
Luc Pattyn24-Feb-08 7:19
sitebuilderLuc Pattyn24-Feb-08 7:19 
GeneralRe: Maths Homework - My boys (not mine - honest!!) Pin
kinar12-Mar-08 19:43
kinar12-Mar-08 19:43 
GeneralRe: Maths Homework - My boys (not mine - honest!!) Pin
SilimSayo20-Mar-08 4:02
SilimSayo20-Mar-08 4:02 
GeneralRe: Maths Homework - My boys (not mine - honest!!) Pin
kinar20-Mar-08 12:28
kinar20-Mar-08 12:28 
GeneralImage Processing Pin
LizzieCode22-Feb-08 9:37
LizzieCode22-Feb-08 9:37 
GeneralRe: Image Processing Pin
Alan Balkany25-Feb-08 4:25
Alan Balkany25-Feb-08 4:25 
GeneralRe: Image Processing Pin
Sameerkumar Namdeo2-Mar-08 16:24
Sameerkumar Namdeo2-Mar-08 16:24 
GeneralRe: Image Processing Pin
Alan Balkany3-Mar-08 3:13
Alan Balkany3-Mar-08 3:13 
GeneralNice Tool Pin
Bassam Abdul-Baki19-Feb-08 4:59
professionalBassam Abdul-Baki19-Feb-08 4:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.