(42S) Matrix Sort
|
07-05-2018, 08:28 PM
Post: #3
|
|||
|
|||
RE: (42S) Matrix Sort
(07-05-2018 08:16 PM)Joe Horn Wrote: For a much faster sort (and probably a shorter program), combining the "hidden" [MIN] and [MAX] functions built into the HP-42S with the R<>R function allows rapid sorting of the rows in a matrix into ascending or descending order using any desired column as the sorting key. Ah, I didn't realize the hidden MIN and MAX functions were column-specific and could have a starting point specified like that. That would make for a pretty easy selection sort implementation, and while that's the same complexity class as bubble sort, having MIN doing all the heavy lifting in the innermost loop would probably improve performance. I'll have to take a stab at that later this evening. Half the reason I post things in the software library is because somebody undoubtedly knows some clever functions/tricks that I can learn about to make the program better. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(42S) Matrix Sort - Dave Britten - 07-05-2018, 06:08 PM
RE: (42S) Matrix Sort - Joe Horn - 07-05-2018, 08:16 PM
RE: (42S) Matrix Sort - Dave Britten - 07-05-2018 08:28 PM
RE: (42S) Matrix Sort - Joe Horn - 07-05-2018, 09:17 PM
RE: (42S) Matrix Sort - Dave Britten - 07-05-2018, 09:27 PM
RE: (42S) Matrix Sort - Joe Horn - 07-05-2018, 10:21 PM
|
User(s) browsing this thread: 1 Guest(s)