Description:
- Currently, the brute force approach contains length check as an exit condition for the inner loop.
- I believe this logic can be re-written in a better way, so looking for it.
It can be with while() loop or maybe for loop(s) without if() condition which checks the length.
Code which I am talking about:
|
private bool IsLinkedListCyclic() |
Description:
It can be with
while()loop or maybeforloop(s) withoutif()condition which checks the length.Code which I am talking about:
Data-Structure-In-CSharp/Linked-List-Problems/CyclicLinkedList-BruteForce.cs
Line 31 in 9a795e9