LogFAQs > #970092098

LurkerFAQs, Active DB, DB1, DB2, DB3, DB4, DB5, DB6, DB7, DB8, DB9, DB10, Database 11 ( 12.2022-11.2023 ), DB12, Clear
Topic List
Page List: 1
TopicI know what a Linked List is
Questionmarktarius
12/11/22 5:29:01 PM
#34:


[LFAQs-redacted-quote]

There's not a lot of easy ways to find a loop that loops several nodes back.
If you can't mess with the class itself for a sentinel, clone the entire list. Then iterate the clone while unsetting prior nodes. When you ht a null pointer, you've either found a loop or some other serious problem with the list.
... Copied to Clipboard!
Topic List
Page List: 1