News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Rule of thumb on Sorting...supposedly

Started by Raistlin, March 28, 2020, 03:46:37 AM

Previous topic - Next topic

Raistlin

Disclaimer:
More of a click-bait post, counter to my normal musings.
You have been warned. :undecided:

Consider please....
Sorting algos listed fastests (above others in
the same grouping [Log Scale] as proclaimed generizable assertion)
according to assembly enthusiast you-tuber (reference on PM request
if interested):
Small number of elements = Insertion sort (max 50 to 100 elements) 
Mid size number of elements = STD-STL sort (up to max 1500 or so)
Large sizes = Radix sort (very large 2000+ and beyond)

Your thoughts appreciated. My own crappy code attempt
to follow.

Regards
Raistlin
Are you pondering what I'm pondering? It's time to take over the world ! - let's use ASSEMBLY...

daydreamer

Different way of sort, new kinda challenge , wonder what will be fastest with unicode Chinese numbers?,ascii is simple 0-9 all in right order
Chinese unicode number characters, is random order 1,2,3,4,5,6,7,8,9,10,100,1000,10000...
Is placed maybe complexity or number of lines among cjk kanji characters?
http://masm32.com/board/index.php?topic=8416.msg92116#new
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

jj2007

Quote from: Raistlin on March 28, 2020, 03:46:37 AM
Large sizes = Radix sort (very large 2000+ and beyond)

ArraySort() uses a radix sort. It is very fast, and beats all other algos when sorting small integers, e.g. up to 2^16 or so. For strings I use a stable MergeSort instead.

For all sorts 2000+ is not "very large" but rather "tiny". Sorting 44,000 strings takes typically 70ms, but for one Million strings you need a full second. Sorting small numbers of elements (<10,000) is always blazing fast. The real challenge starts above one Million.

Adamanteus

Maybe you'll be interested in Skip-list algo for Large sizes lists.

jj2007

Quote from: Adamanteus on March 28, 2020, 10:18:17 PM
Maybe you'll be interested in Skip-list algo for Large sizes lists.

Quotea linked list-like structure that allows insertion, which is not possible in an array

Written by a linked list fan :cool:

Adamanteus

Quote from: jj2007 on March 29, 2020, 01:29:34 AM
Written by a linked list fan :cool:
Really, I mean algo that in cases decrease amount of comparations, for sorting algo - for huge amount of data good.

daydreamer

special case:but wasnt BSP tree slowest when precalculating and fastest when its just traverse a Binary tree to a leaf that tells it which walls are visible?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding