Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math.independent

Topic: My sorting algorithm that counts in values in arrays, JTsort or Countsort
Replies: 1   Last Post: Jan 4, 2013 9:40 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Ben Bacarisse

Posts: 924
Registered: 7/4/07
Re: My sorting algorithm that counts in values in arrays, JTsort or Countsort
Posted: Jan 4, 2013 9:40 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

JT <jonas.thornvall@gmail.com> writes:

> On 4 Jan, 04:05, JT <jonas.thornv...@gmail.com> wrote:
>> I once created this algorithm that works a bit backward it actually
>> first create the range of numbers in an array and actually just count
>> them in to different slots in an array no sorting needed.

<snip>
> Can not just anyone tell me if this is a known sorting algorithm or
> even sorting,


Yes, it is well-known. There are also slightly more general versions
like radix sort that remove the restriction on the range of the values
being sorted.

> i do understand that it is faster then other known
> algorithms, but maybe not practical, what is the disadvantages of this
> approach?


It is practical is some cases and not in others. The main disadvantage
is that it only works for sorting integers in a range that can be used
to index an array, and it will be slower than many other algorithms even
for some very short inputs.

--
Ben.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.