![]() | |
#11
| |||
| |||
|
|
I think what you describe is clumsy |
|
and only barely works in the specific application you describe. Grow the application and it will break as your solution is delicate. |
#12
| |||
| |||
|
|
As I mentioned the thing that makes the Radix Sort so valueable, besides being disk-file-based, is that its complexity is O(N). Other sort methods in general are either O(N^2) or O(N log N). |
|
Another thing I like is the simplicity of the Radix Sort. I am not a database person, so for me this is an excursion into an area I have not mastered. The fact that the Radix Sort is so easy to implement in C is a blessing. |
|
It is overkill for small sorts, for which I use the C Library function "qsort". Now I have both ends of the spectrum covered. |
#13
| |||||
| |||||
|
|
I see nothing about the Radix sort which makes it "disk based." |
|
Your solution is clumsy because it depends on your source data having some sort of order and uniform distribution. |
|
Should be several sort routines in your existing C libraries. |
|
What I described wasn't so much as a sort algorithm but a means of overflowing in temporary files. I said to sort in memory, but didn't make any recommendations as to how one should sort in memory. |
|
It is overkill for small sorts, for which I use the C Library function "qsort". Now I have both ends of the spectrum covered. Most any in-memory sort will be faster than any disk-based sort. |
#14
| |||
| |||
|
|
I have a disk file which contains 370,260 records of average length 60 ASCII text characters. I need to sort them on the first 9 characters, which are set off from the rest by a space. Once sorted the first record looks like 100100100 08:35-08:39 4 0 0 1 -115 -1 75 -100 dd17.txt and the last one looks like 500900900 12:41-13:25 44 1 885 0 0 1 925 -200 dd21.txt |
#15
| |||
| |||
|
|
Citizen Bob wrote: I have a disk file which contains 370,260 records of average length 60 ASCII text characters. I need to sort them on the first 9 characters, which are set off from the rest by a space. Once sorted the first record looks like 100100100 08:35-08:39 4 0 0 1 -115 -1 75 -100 dd17.txt and the last one looks like 500900900 12:41-13:25 44 1 885 0 0 1 925 -200 dd21.txt What's wrong with importing it into Excel? |
#16
| |||
| |||
|
|
I have a disk file which contains 370,260 records of average length 60 ASCII text characters. I need to sort them on the first 9 characters, which are set off from the rest by a space. Once sorted the first record looks like 100100100 08:35-08:39 4 0 0 1 -115 -1 75 -100 dd17.txt and the last one looks like 500900900 12:41-13:25 44 1 885 0 0 1 925 -200 dd21.txt There is not enough memory in my Win2K/SP4 system to implement the traditional memory-based sorting algorithms, so I need to use a method that is disk-file based. I have plenty of disk space. I imagine that this method would open the input disk file and begin reading records one at a time and performing some kind of sort algorithm placing the result in a temporary output file. Once the original file has been swept, the process starts over and runs again and again for the required number of iterations until the entire list is sorted in ascending order. I will implement this method in standard DOS-based C (Microsoft Optimizing C Compiler "cl") using the Win2K DVM. I suggest you use the Microsoft supplied sort. You can obtain |
#17
| |||
| |||
|
|
I suggest you use the Microsoft supplied sort. You can obtain instructions by typing HELP SORT at the command prompt. |
#18
| |||
| |||
|
|
What's wrong with importing it into Excel? What is the maximum number of rows in an XL sheet? Last time I checked it was way less than 370,260. |
|
/Lennart |
#19
| |||
| |||
|
| David Segall wrote: I suggest you use the Microsoft supplied sort. You can obtain instructions by typing HELP SORT at the command prompt. Or try downloading the bash shell at www.cygwin.com and using the unix sort on windows. Shame on you! That is not supplied by Microsoft. Everything you need |
![]() |
| Thread Tools | |
| Display Modes | |
| |