3 ms·
> It's not possible to write an algorithm that will detect infinite loops in all programs. Actually, it is possible, if the program is not allowed to consume i
by wizeman 4y ago
> It's not possible to write an algorithm that will detect infinite loops in all programs.
Actually, it is possible, if the program is not allowed to consume infinite memory.
That's what these algorithms do (where "value" is the state of the finite-state machine):
https://en.wikipedia.org/wiki/Cycle_detection https://en.wikipedia.org/wiki/Cycle_detection
- deleted 4y ago[deleted]