The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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: 1,972
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 <> writes:

> On 4 Jan, 04:05, JT <> 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.

> 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.


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.