Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Stable Sort algorithm
Stable Sort algorithm [message #61477] Thu, 20 February 2025 17:01 Go to next message
forlano is currently offline  forlano
Messages: 1207
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

do we have in core a STABLE fast sort algorithm?

Thanks,
Luigi
Re: Stable Sort algorithm [message #61478 is a reply to message #61477] Thu, 20 February 2025 17:24 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3432
Registered: August 2008
Senior Veteran
In https://www.ultimatepp.org/srcdoc$Core$Tutorial$en-us.html it appears this:
index.php?t=getfile&id=7048&private=0


Best regards
IƱaki
Re: Stable Sort algorithm [message #61583 is a reply to message #61477] Thu, 20 March 2025 07:28 Go to previous messageGo to next message
JeyCi is currently offline  JeyCi
Messages: 67
Registered: July 2020
Member
can just advise to use COM-dll from bedvit (if it will connect to Upp)
1. ArraySort (String)
2. ArraySort (Variant)


Best regards.
Re: Stable Sort algorithm [message #61590 is a reply to message #61477] Thu, 20 March 2025 19:48 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 725
Registered: November 2008
Location: France
Contributor
Recently I had challenged sort algorithms: Upp, Std, other ...And Upp sorts were the fastest Smile (at least for my use-case)

If you want to transform an unstable alogrithm into stable one, you just need to add data index comparison in you're comparison criteria.
I tried it with Upp sort, and it was faster than stable sort Question (for my use case were there where the comparison criteria was quite complex)
Re: Stable Sort algorithm [message #61617 is a reply to message #61590] Mon, 24 March 2025 22:05 Go to previous messageGo to next message
JeyCi is currently offline  JeyCi
Messages: 67
Registered: July 2020
Member
Didier wrote on Thu, 20 March 2025 19:48

If you want to transform an unstable alogrithm into stable one, you just need to add data index comparison in you're comparison criteria.

as I remember, he took comparator from here. He is developing COM and uses sorting of pointers to memory - that is considered to be faster, but as Iknow, UPP IDE also works with stack and heap directly in its source-files, just hiding pointers to Core and other packages.


Best regards.
Re: Stable Sort algorithm [message #61651 is a reply to message #61590] Fri, 18 April 2025 14:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14255
Registered: November 2005
Ultimate Member
Didier wrote on Thu, 20 March 2025 19:48
Recently I had challenged sort algorithms: Upp, Std, other ...And Upp sorts were the fastest Smile (at least for my use-case)


It is possible they are not faster in general case - they are tuned to sort Upp::String - which usually is the use-case.
Re: Stable Sort algorithm [message #61657 is a reply to message #61651] Sun, 20 April 2025 19:50 Go to previous message
Didier is currently offline  Didier
Messages: 725
Registered: November 2008
Location: France
Contributor
Maybe my use case is close to that:
Sort an array of int based on sort criterias comming from data pointed by the index: sounds pretty close to sorting strings

If m'y memory is good, the upp::sort was 2 times faster than std::sort
Previous Topic: SSL.h
Next Topic: Add compilable testcases for nontrivial problems!
Goto Forum:
  


Current Time: Fri Apr 25 07:54:49 CEST 2025

Total time taken to generate the page: 0.00543 seconds