Post Reply 
Little problem(s) July 2022
07-07-2022, 12:02 PM
Post: #22
RE: Little problem(s) July 2022
(07-07-2022 10:51 AM)pier4r Wrote:  (I hope GET is O(1) with lists in userRPL, now I start to have doubts).

It isn't with lists, but it is with type 3 or 4 arrays.

Remember that lists can contain many different types of objects as elements (even other lists), so the size of each element may vary and cannot be assumed in advance. Lists have no associated metadata (pointers, tables, etc.) that would assist in locating specific elements. The only way to locate element n is to sequentially step through elements 1..(n-1) first.

Conversely, type 3 (real) or 4 (complex) arrays use the same-sized data for each element, so the offset of a specific element is easily computed from its indices.

The varying size of the data elements in a type 29 (symbolic/exact) array give it a data structure very similar to a list, so GET is similarly constrained with those.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Little problem(s) July 2022 - pier4r - 07-04-2022, 06:04 PM
RE: Little problem(s) July 2022 - pauln - 07-05-2022, 01:01 AM
RE: Little problem(s) July 2022 - pier4r - 07-05-2022, 10:00 AM
RE: Little problem(s) July 2022 - pier4r - 07-05-2022, 01:56 PM
RE: Little problem(s) July 2022 - pier4r - 07-07-2022, 10:51 AM
RE: Little problem(s) July 2022 - DavidM - 07-07-2022 12:02 PM
RE: Little problem(s) July 2022 - DavidM - 07-07-2022, 03:09 PM
RE: Little problem(s) July 2022 - pier4r - 07-07-2022, 05:19 PM
RE: Little problem(s) July 2022 - Werner - 07-06-2022, 07:48 AM
RE: Little problem(s) July 2022 - DavidM - 07-07-2022, 05:27 PM
RE: Little problem(s) July 2022 - pier4r - 07-07-2022, 05:37 PM
RE: Little problem(s) July 2022 - pauln - 07-11-2022, 05:34 AM
RE: Little problem(s) July 2022 - pauln - 07-11-2022, 10:32 PM



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