Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to sort negative and positive values ?
#11
I like Luke's approach allot! I've seen it  before, I think, but it really works well in this particular problem that Jack presented. Before seeing Luke's sol'n I would have gone Steve's route, divide problem into 2 sorts but never ever would I touch Bubble Sort with 10 foot pole! b+LOL!

Oh 2112's nice too! hadn't seen it before this reply.
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#12
(02-22-2026, 05:40 PM)bplus Wrote: I like Luke's approach allot! I've seen it  before, I think, but it really works well in this particular problem that Jack presented. Before seeing Luke's sol'n I would have gone Steve's route, divide problem into 2 sorts but never ever would I touch Bubble Sort with 10 foot pole! b+LOL!

Oh 2112's nice too! hadn't seen it before this reply.

    I normally wouldn't use Bubblesort myself.    However, for smallish arrays on any Modern 64 bit system it's probably perfectly sufficient and has the benefit of being very simple maintainable code.   There's probably not much noticeable difference between finishing a sort in 1/100th of a second vis 1/1000th of a second in most instances !
Reply
#13
ABS function is the way I'd go. I bs my way through a lot of things.

Pete Big Grin
Reply
#14
ABS is the way I went as well, just like 2112.  I just separated my data into high/low first, whereas he sorted and then separated.  The difference in the two routines is almost trivial once you study them a bit.  Great minds think alike -- which is why nobody thinks like @Pete does.  His mind is anything BUT great!
Reply
#15
I'll you folks know I have a mind like a steel trap. It snapped shut 60 years ago, and nothing's got in since!

Pete Tongue

I must have rubbed Steve the wrong way... https://qb64phoenix.com/forum/showthread.php?tid=4491
Reply
#16
If you were rubbing on *that* Steve, I'm certain it was the wrong way!!
Reply
#17
Big Grin Big Grin Big Grin 

I have to tell you the ladies who passed that guy just broke up laughing, but for me, personally, I like the Barbara Eden kind of "Jeannies" a whole lot better.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Question on a Quick Sort routine Dimster 4 1,009 09-25-2023, 12:29 PM
Last Post: bplus
  Having trouble Windows command line SORT via SHELL GTC 19 4,367 08-26-2023, 04:19 AM
Last Post: GTC

Forum Jump:


Users browsing this thread: 1 Guest(s)