Technical Interview Question: Number of Islands [LeetCode]

preview_player
Показать описание
In this video, I explain the popular coding interview question Number of Islands.

This problem is asked at Google, Amazon, Facebook, and many other companies.

The idea behind the algorithm is to use a DFS traversal to change all land to water. Each time we encounter land, we will tally up how many islands their are. This problem can be solved using a BFS or Union Find algorithm, but I find the Depth First Search solution the easiest to understand.
Рекомендации по теме
Комментарии
Автор

I just went through all the big youtubers who explained this, and you explained it the best, yet you have the least subscribers - please, I urge you to keep going, you'll gain traction soon, really great quality stuff, good job!

usmanh
Автор

I can't thank you enough, you are a great teacher. I am learning graphs from you and I'm getting over my fear of graphs because of you.

pogostemoncablin
Автор

Best video on this topic. I particularly like the 'sink' analogy, and also the fact you took the time to explain the problem in detail first!

koredyte
Автор

Many explanations on youtube for this question, but this is by far the clearest! The specific naming of changeLandToWater( ) makes it so much clearer compared to dfs( )

robertsedgewick
Автор

Best vid I have seen on this, thanks!

panzabamboo
Автор

Really great explanation. By 4:31 I knew where you were going and had that 'Ah ha' moment and was able to implement it from there on. Thanks!

dimejifaluyi
Автор

Never understood this problem's solution this clearly ! You've explained every single small step in detail .. I'm really glad to have found your channel ! Keep going !!! ^_^
At the end, I was like this problem is so easy and I could not believe that the solution was so easy using recursion. All
thanks to you brother :)

majetyprashanth
Автор

Man you finally made me to understand my hero!!

Dragondavid
Автор

This is a really good explanation! Great job doing in !

johnkim
Автор

The video is really helpful. Keep up the good work and I request you to please draft some more similar videos for other leetcode problems.

soumilmishracomp
Автор

Best explanation on this topic! Loved it (y)

krishika
Автор

Hey Michael, Thank you for this amazing playlist. As I see the maximum questions in the playlist is consist of DFS. Can you make some set of questions where we need to apply BFS and show us how to apply?

Anand
Автор

Thank you so much for explaining this problem so well. :)

snigdhapurohit
Автор

Great video, great explanation. Thank you so much.

anpascally
Автор

Great video. Thanks for your clear explanation.

dustinv
Автор

Very nice explanation ... Clear idea:-)

KnowledgeAmplifier
Автор

Every time you ever go over a problem I say to myself "Why did I ever struggle?"

woodylucas
Автор

For the same algo it's saying maxing recursion depth excided, In pythn

ShashwataSaha
Автор

I am not sure if your up and down notations are correct.

subhadeepbhattacharyya
Автор

Nice! You should create more videos like this but with other problems. 👍🏻

vincenr