Linked List Cycle 2 (LeetCode 142) | Full solution with mathematical proof | Study Algorithms

preview_player
Показать описание
Given a single linked list that contains a loop, find the node where the cycle starts. A very famous problem and an extension of detecting the loop. Using a slow pointer and fast pointer, can help to determine the meeting point. This video gives a mathematical proof on how the pointers meet at the start of loop. All along with diagrams and a dry-run of code in JAVA.

Chapters:
00:00 - Intro
01:11 - Problem statement and description
02:11 - Brute Force approach to find the cycle start point
05:16 - Efficient solution to find the cycle start point
08:27 - Mathematical proof of Floyd-Warshall algorithm
14:52 - Dry-run of code
16:55 - Final Thoughts

📚 Links to topics I talk about in the video:

📖 Reference Books:

🎥 My Recording Gear:

💻 Get Social 💻

#leetcode #programming #linkedlists
Рекомендации по теме
Комментарии
Автор

A teacher deserves the highest appreciation in the world.

jayachandranpm
Автор

Oh my god! Why is your solution not the most viewed solution?!. Just amazing! Thank you so much! <3

curiousnerd
Автор

bro is underrated, he deserve large following

Unknownd
Автор

Thanks a lot for such a detailed, simplified, and perfect explanation. I wish this will reach to max students.

shraddhajain
Автор

mathematical explanation is super...!! thanks a lot..!

jaydeepvasoya
Автор

Very good teacher he is. He explains every concept very well. keep doing good work. Thanks for providing such content for free

susmitapatil
Автор

Very well explained. Had seen the solution about moving fast pointer to head but couldn't agree, but now after watching the visual explanation, I'm very clear.
Thanks again buddy. 👍

astonvaz
Автор

This mathematical proof is so beautifully explained! I'm loving it baba!

AadeshKulkarni
Автор

what a question and what an explaination!!!

SkipperPlaysYT
Автор

best explanation buddy, you got my sub:)

theguywhofilmss
Автор

very very useful lectures sir..Thank you soo much for efforts in making such a clear and useful content..videos

CHANDUMEGHANADEVI
Автор

Thanks for the explanation! was able to understand the logic behind it!

umtropaqualquer
Автор

Simplified explaination 👍🏻 Can you please suggest any book to study detailed data structures?

tias
Автор

Thanks for the detailed explanation! I have a question: Why is (n2 - 2n1) always a positive integer? Can it be negative?

oLittleFive
Автор

Hitting that subbscribe button as hard as I can.

HRUSHIKESHSHELAR-rb
Автор

@nikoo28 pk make more videos, your way of teaching and solutions are so good

IshaZaka
Автор

can we remove a loop and return just a straight LinkedList? just asking

RakeshYadav-cmwp
Автор

@nikoo28 At 14:22 Why only slow pointer? Why not fast pointer?

darkexodus
Автор

isnt floyd warshall graph algorithm ??

gauravsharma