Post Reply 
HP 48GX - Store Coordinates in a List
04-02-2021, 12:28 AM
Post: #8
RE: HP 48GX - Store Coordinates in a List
(04-01-2021 09:00 PM)MNH Wrote:  I think as I'm adding points to my list I should sort them in ascending order. When I need to get a point from my list I can execute a binary search. Does that sound logical?

Rather than sorting the list each time a new point is added, I suggest also using a binary search for where the new point should go, then inserting it there. That's much faster than sorting the entire list (if the list is large). A simple User RPL routine which performs insertion into an already-sorted list is here: https://www.hpcalc.org/details/6877

If the above is what you meant, please ignore this reply. Smile

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 48GX - Store Coordinates in a List - Joe Horn - 04-02-2021 12:28 AM



User(s) browsing this thread: 1 Guest(s)