Glossary: Coding Interviews in C++
Cycle
Also written: loop in a linked list
A linked list whose last node links back to an earlier one, so walking it never ends. Fast and slow pointers detect it because the fast one laps the slow one.
Glossary: Coding Interviews in C++
Also written: loop in a linked list
A linked list whose last node links back to an earlier one, so walking it never ends. Fast and slow pointers detect it because the fast one laps the slow one.