3 ms·
A not quite serious solution [1]: Let m = size_of_current_process / sizeof(list_node) + 3 Let np = pointer or reference to first node in list while (n
by tzs 12y ago
A not quite serious solution [1]:
Let m = size_of_current_process / sizeof(list_node) + 3
Let np = pointer or reference to first node in list
while (np != null)
if (m-- == 0)
return HAS_CYCLE
np = np->next
return NO_CYCLE
[1] this approach might actually be acceptable in some circumstances