Tagged articles

fast and slow pointers

1 articles · Page 1 of 1
JavaEdge
JavaEdge
Oct 27, 2021 · Interview Experience

Detecting a Cycle in a Singly Linked List – Fast & Slow Pointer Solution for Tencent Interview

This article explains how to determine whether a singly linked list contains a cycle using three approaches—brute‑force, hash‑marking, and the optimal fast‑and‑slow pointer technique—providing Go and C++ implementations that achieve minimal time and O(1) space complexity suitable for a Tencent interview.

C++GoInterview Question
0 likes · 6 min read
Detecting a Cycle in a Singly Linked List – Fast & Slow Pointer Solution for Tencent Interview