Re: [Tutor] linked list with cycle structure

2009-01-08 Thread David Hláčik
Hi, well i am able to find a loop in a list using two iterators.One iterator runs "two times faster than the other", and if he encounters the first, it means that there is a loop. Example : 1,2,3,4,5,6,7,8,9,5 the algorithm would generate: start - 1,2 iteration 1- 2, 4 iteration 2- 3, 6 iteratio

Re: [Tutor] linked list with cycle structure

2009-01-07 Thread Robert Kern
Terry Reedy wrote: David Hláčik wrote: But what if i have another condition , and that is *i can use only helping memory with constant size* ? This means i am not able to create any set and adding elements there. I need to have a constant size variables . This is complication a complication for

Re: [Tutor] linked list with cycle structure

2009-01-07 Thread David Hláčik
Hi, so okay, i will create a helping set, where i will be adding elements ID, when element ID will be allready in my helping set i will stop and count number of elements in helping set. This is how long my cycled linked list is. But what if i have another condition , and that is *i can use only h

Re: [Tutor] linked list with cycle structure

2009-01-07 Thread Kent Johnson
On Wed, Jan 7, 2009 at 5:59 AM, David Hláčik wrote: > Hello guys, > > I have a linked list where *number of elements is unlimited* and > **last element points on random (can be first, last, in middle , > anywhere) element within linked list** - this is important . My goals > is to create an archit

Re: [Tutor] linked list with cycle structure

2009-01-07 Thread A.T.Hofkamp
David Hláčik wrote: Hello guys, I have a linked list where *number of elements is unlimited* and **last element points on random (can be first, last, in middle , anywhere) element within linked list** - this is important . My goals is to create an architecture /scheme for **algoritmus which will

[Tutor] linked list with cycle structure

2009-01-07 Thread David Hláčik
Hello guys, I have a linked list where *number of elements is unlimited* and **last element points on random (can be first, last, in middle , anywhere) element within linked list** - this is important . My goals is to create an architecture /scheme for **algoritmus which will count total number of