On 8 Jan, 07:10, Kiru Sengal <kiru.sen...@gmail.com> wrote: > On Thursday, January 3, 2013 10:05:28 PM UTC-5, 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. Was i the > > > first person who came up with this idea? I am not that mathematically > > > inclined although i enjoy solve problems with mathematics. As i see it > > > for 100 MB of values it must be superior to any other sorting > > > algorithm because it actually do not sort anything just count it, and > > > this will work as long there is memory to use this type of sort. > > It doesn't sort, just counts it, but will work as a sort :) > > > > > However there must be a limit to the range/size of numbers relative > > > the amount of data to sort, ***at what size of numbers*** will the > > > best algorithm beat countsort using 10TB data? > > Depends. n*log(n) sorts like quicksort might beat it even if your algorithm is (n) for specific "limit/range/size of numbers relative..."
I am kind of tired of numbnuts like you this is not radixsort/ bucketsort, this is rapidsort aka JTsort there is no attached data just the index, so there is no aftersort. It index in linear time, there is no sort. Although this array implementation indeed have memory shortcomings, my pointer implementation working at digit level have none other then that the unique values within set must fit in memory. This is so much better then anything else that it make bubblesort look freakishly fast compared to quicksort, that quicksort look freakishly slow compare to JTsort.
> > > Just from reasoning this algorithm will beat any other algorithm > > > sorting >1 TB data using numbers ranging from 0 - 2^20 on any standard > > > computer given a language that allow an array with 1 048 576 slots. > > > 50 > > 1TB of purely 32 bit integers equals 2.5x10^11 integers. > With a range of 1million values, your data set has on average 250 thousand integers at every number in that range. Is this what you had in mind?
As i said my recursive pointer implementation done -97 only use. _ x digit * S=memory requirments*** "here overlined x means average number of digits * unique members of the set" (You just save a single occurences of each value and their accompanied counter/index within the pointer structure the sorting terms can therefor have any length unlike the array implementation)
> > > > Please inform with if i am wrong. > > > PS Does this really qualify as a sorting algorithm. > > It is called bucket sort where each bucket is a single integer value (instead of a range). > > This is (a variation of) what humans use to sort exam papers by grade (100, 99) or last name (A,B,C,..).