Network Delay Time (Djikstra's Algorithm) - Leetcode 743 - Graphs (Python)

  Рет қаралды 3,370

Greg Hogg

Greg Hogg

Күн бұрын

Пікірлер: 19
@GregHogg
@GregHogg 4 ай бұрын
Master Data Structures & Algorithms For FREE at AlgoMap.io!
@user-jm6gp2qc8x
@user-jm6gp2qc8x 2 ай бұрын
heapq is doing a lot of heavy lifting for us here
@saurabhbhagat4528
@saurabhbhagat4528 Ай бұрын
Yes, and here in JavaScript I have to implement create/insert/delete everytime a heap is involved 😅
@ericsigne6575
@ericsigne6575 8 күн бұрын
@@saurabhbhagat4528 if it's in leetcode, you can just call the min priority queue class as new MinPriorityQueue(). The same logic can be used for max priority queue.
@JSH1994
@JSH1994 2 ай бұрын
thanks for the clear explanation!
@__chroma__8660
@__chroma__8660 Ай бұрын
is ther eany similarity between the min heap in dijkstras, and the min heap used in prims mst algo?
@mehraan8592
@mehraan8592 28 күн бұрын
Should we not update the cost to reach a node even if it is already in min_times because a different path may give a lesser cost/time? Please help.
@chisomedoka5651
@chisomedoka5651 3 ай бұрын
Great video once again, please create one for BellmanFord
@aakashs1806
@aakashs1806 Ай бұрын
Can we solve this problem in prims algorithm??
@AnkitKumar-qe9to
@AnkitKumar-qe9to 5 ай бұрын
Thank you @GregHogg
@GregHogg
@GregHogg 5 ай бұрын
You're very welcome :)
@e889.
@e889. 6 ай бұрын
Never stop uploading
@GregHogg
@GregHogg 5 ай бұрын
Won't
@e889.
@e889. 5 ай бұрын
@@GregHogg where to DM you??
@ashokchourasia
@ashokchourasia 6 ай бұрын
correct the title of video
@GregHogg
@GregHogg 6 ай бұрын
Thanks so much, fixed :)
@otheraccount1270
@otheraccount1270 Ай бұрын
Heapq.heapify(min_heap) missing in code.
@mehraan8592
@mehraan8592 28 күн бұрын
There is only one value initialized there and after that all values pushed are heappushed so there is no need for it. I maybe wrong. :)
@maybae10
@maybae10 6 күн бұрын
@@mehraan8592 you're absolutely right! no need to heapify as the heap initially starts w a single value. then we heappush every val we add; this operation adds the curr val to end of arr and makes sure the position of the curr val maintains heap properties, moving it up or down as needed (log(N) time)
Rotting Oranges - Leetcode 994 - Graphs (Python)
16:09
Greg Hogg
Рет қаралды 3,4 М.
Network Delay Time - Dijkstra's algorithm - Leetcode 743
19:48
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 4,5 МЛН
Players push long pins through a cardboard box attempting to pop the balloon!
00:31
The Ultimate Sausage Prank! Watch Their Reactions 😂🌭 #Unexpected
00:17
La La Life Shorts
Рет қаралды 8 МЛН
Explained To Create Adaptive RAG using LangGraph / LangChain
14:22
LetsLearnWithChinnoVino
Рет қаралды 3
Network Delay Time | Leetcode #743
19:37
Techdose
Рет қаралды 19 М.
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 245 М.
Pacific Atlantic Water Flow - Leetcode 417 - Graphs (Python)
17:10
8 patterns to solve 80% Leetcode problems
7:30
Sahil & Sarra
Рет қаралды 438 М.
Coin Change - Leetcode 322 - Dynamic Programming (Python)
15:27
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 4,5 МЛН