linked list with cycle structure

Diez B. Roggisch deets at nospam.web.de
Wed Jan 7 08:22:16 EST 2009


David Hláčik wrote:

> dictionary with cycle structure
> 
> 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 elements** of such linked list.
> Yes , maybe it sounds strange, but we need to implement this and i
> would be very gladfull for your toughts.

Time for homework again? Last time sorting in O(n), now this. How about you
try something yourself and show us the results - then we might comment on
enhancements or problems.

Diez



More information about the Python-list mailing list