On Sat, Dec 13, 2008 at 10:24 AM, David Hláčik wrote:
> 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 inte
Thank you guys for help and support! My homework is done and waiting
for grading.
Here it comes - bucket sort with time complexity O(n) == linear complexity
#! /usr/bin/python
def sort(numbers):
"sort n positive integers in O(n) provided that they are all from
interval [1, n^2]"
Jerry Franz wrote:
>
> Nicolas Thierry-Mieg wrote:
>> Jerry Franz wrote:
>>> Marko Vojinovic wrote:
>>> [...]
Basically, count the number of appearances of every number in your set. If
you
have a set a priori bounded from above and below --- which you do,
[1, n^2] --- you f
Marko Vojinovic wrote:
> On Sunday 14 December 2008 03:33, Jerry Franz wrote:
>> [...]
>> By definition, your proposed algorithm is O(n^2), not O(n).
>>
>> ;)
>
> Oh, you mean because the upper bound is n^2, right? Sure, of course, this
> particular case is O(n^2). Your proposal in your other p
Nicolas Thierry-Mieg wrote:
>
> Jerry Franz wrote:
>> Marko Vojinovic wrote:
>> [...]
>>> Basically, count the number of appearances of every number in your set. If
>>> you
>>> have a set a priori bounded from above and below --- which you do,
>>> [1, n^2] --- you first allocate an array of in
Jerry Franz wrote:
>
> Marko Vojinovic wrote:
> [...]
>> Basically, count the number of appearances of every number in your set. If
>> you
>> have a set a priori bounded from above and below --- which you do,
>> [1, n^2] --- you first allocate an array of integers of length n^2.
>
> By defin
On Sunday 14 December 2008 03:33, Jerry Franz wrote:
> Marko Vojinovic wrote:
> [...]
>
> > Basically, count the number of appearances of every number in your set.
> > If you have a set a priori bounded from above and below --- which you do,
> > [1, n^2] --- you first allocate an array of integers
Marko Vojinovic wrote:
[...]
> Basically, count the number of appearances of every number in your set. If
> you
> have a set a priori bounded from above and below --- which you do,
> [1, n^2] --- you first allocate an array of integers of length n^2.
By definition, your proposed algorithm is
> >> 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 compl
David Hláčik wrote:
> Well, something with linear complexity O(n) which i have to prove,
>
> Merge sort, Insertion sort or selection sort does not have O(n) complexity.
>
> I believe that something like RadixSort, CountingSort, BucketSort
> altought i am not sure
I'm not especially inclined to
Well, something with linear complexity O(n) which i have to prove,
Merge sort, Insertion sort or selection sort does not have O(n) complexity.
I believe that something like RadixSort, CountingSort, BucketSort
altought i am not sure
Thanks!
D.
On Sat, Dec 13, 2008 at 7:51 PM, Ignacio Vazquez-Ab
On Sat, 2008-12-13 at 19:24 +0100, David Hláčik wrote:
> 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 in
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
13 matches
Mail list logo