|
Posted by ZeldorBlat on 10/13/20 11:34
Curtis wrote:
> The only way I can presently see to solve the problem is
> with linked lists, and backwalk the link paths when, say, E
> calls B. But I've never worked on this issue before, so
> maybe there's a simpler algorithm that hasn't occurred to
> me?
>
Well, you basically just described the best algorithm out there. By
doing a depth first search of the tree you can detect cycles pretty
easily.
Navigation:
[Reply to this message]
|