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?
--
This message and any attachments are intended only for the use of the addressee
and may contain information that is privileged and confidential. If the reader
of the message is not the intended recipient or an authorized representative of
the intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication
in error, please notify us immediately by e-mail and delete the message and any
attachments from your system.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN