David Hláčik wrote: > 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 > 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 me.
This isn't to hard - think about what you are really interested in - knowing if *all* other elements are already counted, or a specific one? You can get away with only one, to detect the cycle and abort. Diez -- http://mail.python.org/mailman/listinfo/python-list