HP3000-L Archives

December 2001, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stan Sieler <[log in to unmask]>
Reply To:
Stan Sieler <[log in to unmask]>
Date:
Thu, 27 Dec 2001 10:30:30 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (24 lines)
Re:
> tree.  Until now I've quite simply disallowed 'multiple parents', but
> largely because my brain's too feeble to see a cleaner loop-avoidance
> mechanism.
...
> ActA
>  |-ActB

As you "enter" an activity (ActA above would be the first), check in
an (initially empty) "Activity Seen" table.  If it's there, you've got a loop,
so don't recursively visit it (and take whatever action is appropriate).
If it isn't there, add it to the table and recursively visit it.

If your activities are small numbers, or small letters, or something similar
that can be used as an index into a small array, simply use the activity name
as a index into a "seen_this_activity" bitmap.  Otherwise, use some other
mechanism (chosen based on your expectation of average and worst-case number of
activities).
Stan Sieler                                           [log in to unmask]
www.allegro.com/sieler/wanted/index.html          www.allegro.com/sieler

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2