Re: [Tutor] linked list with cycle structure

2009-01-08 Thread David Hláčik
on 2- 3, 6 iteration 3- 4, 8 iteration 4- 5, 5 ( match) But how can this help me with counting list elements? :( Thanks, D. On Thu, Jan 8, 2009 at 5:48 PM, Diez B. Roggisch wrote: > > David Hláčik wrote: > > > Hi, > > > > so okay, i will create a helping set, where i will be

Re: [Tutor] linked list with cycle structure

2009-01-07 Thread David Hláčik
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. Thanks in advance! David On Wed, Jan 7, 2009 at 2:22 PM, Diez B. Roggisch wrote: > > David

[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

Re: [Tutor] stable algorithm

2008-12-14 Thread David Hláčik
Hi, thank you very much. And how can i write single test which will tell me execution time of this algorithm? I need to write a table with number of data & execution time comparison (and it should be linear in case of this algorithm) Thanks! D. On Sun, Dec 14, 2008 at 5:58 PM, Alan Gauld wro

Re: [Tutor] stable algorithm

2008-12-14 Thread David Hláčik
> def sort(numbers): >"sort n positive integers in O(n) provided that they are all < n^2" Sorry about wrong comment, should be range from [1 to n^2] not only < n^2. D. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listin

Re: [Tutor] stable algorithm

2008-12-14 Thread David Hláčik
> > Does that mean its homework? > Hi, yes it is homework , this is result : #! /usr/bin/python def sort(numbers): "sort n positive integers in O(n) provided that they are all < n^2" N = len(numbers) # get size of test numbers buckets_mod = [[] for i in xrange(N)]

[Tutor] stable algorithm

2008-12-14 Thread David Hláčik
Hi guys, i am really sorry for making offtopic, hope you will not kill me, but this is for me life important problem which needs to be solved within next 12 hours.. I have to create stable algorithm for sorting n numbers from interval [1,n^2] with time complexity O(n) . Can someone please give m