(Remade) Dijkstra's Algorithm | BFS | Network Delay Time | Leetcode 743
Vložit
- čas přidán 22. 04. 2020
- Topic: Dijkstra | Breadth First Search
Time Complexity: O(ElogE)
Space Complexity: O(V + E)
Code:
github.com/Nideesh1/Algo/blob...
Leetcode:
leetcode.com/problems/network...
Note I claim no rights to this question. All rights belong to Leetcode. If I'm reviewing a solution that was from another Leetcode user or Leetcode itself I will give credit below.
Credit to : Leetcode Solution | leetcode.com/problems/network...
A fantastic tool to help visualize algorithms: algorithm-visualizer.org/
Their github link: github.com/algorithm-visualiz...
Hey there! Just wanted to let you know that some of the below links in this video description are affiliate links, which means that if you make a purchase through them, I may earn a small commission. Don't worry though, it doesn't cost you anything extra and it helps support this channel so I can continue to make more videos for you. Thank you so much for your support, and as always, all opinions are my own!
Start getting great at system design: bytebytego.com?fpr=nideesh (affiliate link)
Handpicked Algorithms and Data Structures for Interview To Save Time: interviewpen.com/?via=nideesh (affiliate link)
Fast track to becoming a knowledgeable SWE www.educative.io/unlimited?af... (affiliate link)
Thanks for your videos! Just want other viewers to know that there is no need to compare the res with Math.max, because pq polls all possible distances strictly from the smallest to the biggest. So each time you update res, res would be bigger. And in the end, res would be automatically the biggest, which is the longest time you need to access all nodes ;)
Hi Kangni, yes you're right! Good observation
0:00 Outline
0:21 Input/Output
1:39 BFS vs Dijkstra
4:38 Dry Run
8:34 Algo Visualizer
9:00 Code
11:20 Time/Space Complexity
I made a mistake by writing 742 on the top, I meant to write 743
Hey there! Just wanted to let you know that some of the links in this comment are affiliate links, which means that if you make a purchase through them, I may earn a small commission. Don't worry though, it doesn't cost you anything extra and it helps support this channel so I can continue to make more videos for you. Thank you so much for your support, and as always, all opinions are my own!
Start getting great at system design: bytebytego.com?fpr=nideesh (affiliate link)
Handpicked Algorithms and Data Structures for Interview To Save Time: interviewpen.com/?via=nideesh (affiliate link)
Fast track to becoming a knowledgeable SWE www.educative.io/unlimited?aff=K1z6 (affiliate link)
Great video, please keep up the good work. The animation in the end was good.
amazing video bro!! Cleared all the confusions and made it so much more inuitive
Great explanation. I could visualize the whole thing easily.
Great Video Nideesh ..
Awesome man. Great video.
thanks bro
nice brother,keep it up
Excellent video
Keep up good work
Thanks Jeff!
very nice
increase font size on white board. It is hard to read even in HD
I think
dist.put(K, 0); // should be commented. and also
max = Math.max(max, dis); // should go after `if (dist.containsKey(node)) {continue;}` and before `if (adj.containsKey(node))`
correct me if I'm wrong
You are correct, bug in the code. But the nonetheless, its a good video.
@@MohanRaj-vp1zt obviously you are also correct
are you indian ?? but you don't sound like indian .. very different accent
Yes I'm Indian 100%! I sound like this cause I grew up in America