hello friends could anybody give me idea how i can find a loop in simple linked list
johnray31
0
Junior Poster in Training
Recommended Answers
Jump to PostIf this is the common interview question then you want two iterators, one skipping ahead by a single node each step, and one skipping two nodes. If the two iterators meet before the end of the list, you've found a loop.
If this is not the common interview question, …
Jump to PostBy saying "how i can find a loop in simple linked list"
do you mean like in my little drawing ?
( In a "normal linked list cell 10 would have point to NULL")[1] ->[2] ->[3] ->[4] ->[5] ^ | | U [10] [6] ^ | …
All 5 Replies
Narue
5,707
Bad Cop
Team Colleague
johnray31
0
Junior Poster in Training
dude543
2
Light Poster
Narue
5,707
Bad Cop
Team Colleague
dude543
2
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.