07-13-2005 04:59 PM
07-13-2005 05:32 PM - edited 07-13-2005 05:32 PM
Message Edited by altenbach on 07-13-2005 03:47 PM
07-14-2005 08:09 AM
07-14-2005 10:03 AM
07-14-2005 10:58 AM
@E.R wrote:
Try This
Your code is much less efficient than what I posted, and it is not O(NlogN), but O(N²) (a 10x increase in size will take 100x more time!). It will scale very poorly with large array inputs:
Some casual benchmarks in milliseconds for inputs with random numbers:
N My version Your version comment
For large arrays, your version cannot be used at all. 😞
07-14-2005 12:04 PM
07-18-2005 10:17 PM
@falkpl wrote:
Yes stick with a O(NLogN), there are a few different sorting algorithms with a big O to match this. Usually when picking a sort or search algorithm you have a trade off between speed and memory use, since memory is so cheap (my first computer had 2k of RAM) I would optimize for speed. What algorithm does the array sort function provided by NI use? Anyone know?
07-19-2005 06:54 AM
Christian,
Thanks for the link, I am too used to the rapid application development and get lazy accepting any pre-canned functions and don't implement my own algorithms much anymore. Have you seen any algorithms which take advantage of the multi-threading(hyperthreaded) and multiprocessors (parallel algorithms) systems which are so commonplace today. Congratulations on reaching the 2000 posts mark.
Paul
07-19-2005 07:13 AM
07-19-2005 10:20 AM