Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Quick Sort for variable length strings
#4
Code: (Select All)
  Quick Sort time: .364000000001397
..      ...3w1C  ...E9kxK  ...F43q  ...Kds    ..0fw    ..0t8    ..16PR.m
..1ISn  ..1L2l

zzx7ajE  zzxNTbv  zzy1      zzy5      zzy7anq  zzyRJgl  zzyTO3    zzz
zzzuaby  zzzz7

  Comb Sort time: .8060000000041327

  QSort wins again!

Both are doing this million sort in less than a second, which I find more than sufficient for the vast majority of my needs.  Either is a good go-to for folks to just plug into their source.  QuickSort is generally faster, unless the data is already well sorted and CombSort triggers that swap=0 early exit after just a few quick passes.  I just personally find the comb sort to be less dangerous (no recursion or stack limits), and I've worked with it enough over the years that I can tweak it for any use case almost instantly.  

As always, folks just need to use whatever works best for them.  As long as *you're* happy with the compiled result, it's a good result.  

Big Grin Smile
Reply


Messages In This Thread
Quick Sort for variable length strings - by bplus - 03-10-2026, 11:01 AM
RE: Quick Sort for variable length strings - by SMcNeill - 03-10-2026, 03:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Quick Paste Pete 2 505 09-26-2025, 07:07 AM
Last Post: Pete
  Variable characters eoredson 7 1,535 10-21-2024, 02:55 AM
Last Post: eoredson
  Load Sort bplus 6 1,393 04-30-2024, 08:35 PM
Last Post: SMcNeill
  Comb Sort versus Quick Sort bplus 13 3,354 07-14-2023, 02:10 PM
Last Post: SMcNeill
  Drawing with Lines of Variable Thickness James D Jarvis 6 1,442 10-19-2022, 06:06 PM
Last Post: James D Jarvis

Forum Jump:


Users browsing this thread: 1 Guest(s)