The issue with playing with pointers is that the storage would be lost. Blocks
have quite variant lengths.

I guess I could create X areas and release an area when all items in the area
have been deleted (perhaps transfer items if the remaining count is low).

On Mon, 30 Dec 2024 06:44:33 +0000 "Farley, Peter"
<[email protected]> wrote:

:>Sounds to me like a deque with functions q.popleft() to remove at the left 
side, q.append() to add at the right side.  Scan process would be a series of 
popleft calls with append for the ones being left for a later time.
:>
:>E.G. (pseudocode):
:>
:>Scan(q) {
:>    Curlen = len(q)
:>    For qx = 1 to Curlen {
:>        Qitem = q.popleft()
:>        If Qitem is NOT to be removed {
:>            q.append(Qitem)
:>        }
:>        Else { Process removed Qitem }
:>    }
:>}
:>
:>If the “Qitems” are relatively large in size and all at different addresses 
then the deque structure (which can be a dynamically sized array) can just 
store pointers to the actual items, resulting in not a lot of data movement at 
all.
:>
:>FWIW, I have done something like this in COBOL, though not for an employer.
:>
:>HTH
:>
:>Peter
:>
:>From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Binyamin Dissen
:>Sent: Sunday, December 29, 2024 3:51 PM
:>To: [email protected]
:>Subject: Ideas of managing a data structure
:>
:>
:>The data structure consists of various items of different lengths. The items
:>
:>are added serially and periodically the area is scanned where most items are
:>
:>removed. The remaining items are likely to be removed in a later scan (with
:>
:>new items).
:>
:>
:>
:>My thought was to have two data areas, and during the scan insert the
:>
:>undeleted items into the alternate area. It will be a bit of data moves but is
:>
:>simple.
:>
:>
:>
:>Does Knuth talk about such a data structure?

--
Binyamin Dissen <[email protected]>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to