• Print

Author Topic: Is this fast? A specialized Integer routine  (Read 92 times)

codeguy

  • Hero Member
  • *****
  • Posts: 4054
  • what the h3ll did i name that code?
    • stuff at dkm
Is this fast? A specialized Integer routine
« on: April 11, 2018, 12:05:06 pm »
Attached is an algorithm for one purpose: to sort a random array of unique sequential integers fast as possible without direct placement. I cannot think of anything faster. Even beats flashsort by a 4 to 1 margin. You ask the practicality of this. It is for restoration of original order to indexed array types. This algorithm is INCREDIBLY fast. Even verified by the included code (always check your work to make absolutely certain it is correct) in the attachment.
An example of the proposed data type:
TYPE IndexKey
Index as long '* numbered sequentially, starting from 0, incremented by 1
PartName as String * 37 '* could be any data,  really
PartCost as Double
END TYPE

268,435,456 of these rearranged by sequential index in less than a minute on a 2.16GHz machine. Yes,  it's  not flashy, but it is silently swift. On descending  without inversion, descending takes longer.  Using inversion, it is actually faster than the ascending sort. Thanks for putting up with my boring stuff.

















http://denteddisk.forums-free.com/make-an-appointment-with-the-resident-code-guru-f34.html

codeguy

  • Hero Member
  • *****
  • Posts: 4054
  • what the h3ll did i name that code?
    • stuff at dkm
Re: Is this fast? A specialized Integer routine
« Reply #1 on: April 11, 2018, 12:14:54 pm »
A picture of a sample run. It's  worth a thosand words.  Perhaps > 268 million of them.
http://denteddisk.forums-free.com/make-an-appointment-with-the-resident-code-guru-f34.html

  • Print