[<<][staapl][>>][..]
Mon Jul 21 23:24:05 EDT 2014

Linked lists - specialized as sorted sets

To implement the lists, might be best to separate indexing from
storage, i.e. use separate pages.  Since we're always going to have to
put hard limits on the size of the lists, it doesn't matter where we
put things.

So implement a list linked list in a single page.

Wait, what I need is a list of sorted, unique numbers.  This might be
done with indices only.

An element is not in the list if it points to #xFF
Head of the list is stored in a variable.
Each cell just contains the number as the address.

So 7,5,18 is implemented as

var head = 7
cell 7 = 5
cell 5 = 18
cell 18 = FF


one problem: remove is not simple since this is a singly linked list.
it requires a scan from the head.

this might be a good case for iteration macros, i.e. begin..end
constructs that act as a for loop but iterate a pointer over a data
structure.




[Reply][About]
[<<][staapl][>>][..]