KZ
bin
Негізгі бет
Қазірдің өзінде танымал
Тікелей эфир
Ұнаған бейнелер
Қайтадан қараңыз
Жазылымдар
Кіру
Тіркелу
Ең жақсы KZbin
Фильм және анимация
Автокөліктер мен көлік құралдары
Музыка
Үй жануарлары мен аңдар
Спорт
Ойындар
Комедия
Ойын-сауық
Тәжірибелік нұсқаулар және стиль
Ғылым және технология
2022. Convert 1D Array Into 2D Array | Leetcode POTD Explained
7:37
Valhalla - Where Are We? #JVMLS
51:07
МАИНКРАФТ В РЕАЛЬНОЙ ЖИЗНИ!🌍 @Mikecrab
00:31
😲 Гаишник шокировал водителя Мерседеса такими новостями! | Новостничок
00:26
How Strong is Tin Foil? 💪
00:26
Участник рассмешил Диму Журавлева 😂 | Смотри Удиви меня в VK Видео!
00:48
1514. Path with Maximum Probability | BFS | DFS | Leetcode POTD Explained
Рет қаралды 76
Facebook
Twitter
Жүктеу
1
Жазылу 221
Jeevesh Rai
Күн бұрын
Пікірлер: 1
@codeby_naruto
18 күн бұрын
Code :- class Solution { public: double maxProbability(int n, vector& edges, vector& succProb, int start_node, int end_node) { vector adjList(n); for (int i = 0; i < edges.size(); i++) { int u = edges[i][0]; int v = edges[i][1]; adjList[u].push_back({ v, succProb[i] }); adjList[v].push_back({ u, succProb[i] }); } vector maxProb(n, 0); maxProb[start_node] = 1.0; priority_queue pq; pq.push({ 1.0, start_node }); while (!pq.empty()) { auto curr = pq.top(); pq.pop(); double currProb = curr.first; int currNode = curr.second; if(currNode==end_node) return maxProb[end_node]; for (auto node : adjList[currNode]) { int nextNode = node.first; double nextProb = node.second; if (currProb * nextProb > maxProb[nextNode]) { maxProb[nextNode] = currProb * nextProb; pq.push({ currProb * nextProb, nextNode }); } } } return maxProb[end_node]; } };
7:37
2022. Convert 1D Array Into 2D Array | Leetcode POTD Explained
Jeevesh Rai
Рет қаралды 66
51:07
Valhalla - Where Are We? #JVMLS
Java
Рет қаралды 20 М.
00:31
МАИНКРАФТ В РЕАЛЬНОЙ ЖИЗНИ!🌍 @Mikecrab
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 37 МЛН
00:26
😲 Гаишник шокировал водителя Мерседеса такими новостями! | Новостничок
НОВОСТНИЧОК
Рет қаралды 12 МЛН
00:26
How Strong is Tin Foil? 💪
Preston
Рет қаралды 70 МЛН
00:48
Участник рассмешил Диму Журавлева 😂 | Смотри Удиви меня в VK Видео!
BUBBLEGUN LIFE
Рет қаралды 11 МЛН
17:33
2699. Modify Graph Edge Weights | Dijkstra's algorithm | Leetcode POTD Explained
Jeevesh Rai
Рет қаралды 1 М.
13:31
725. Split Linked List in Parts | Leetcode POTD Explained
Jeevesh Rai
Рет қаралды 106
22:31
Dynamic Programming isn't too hard. You just don't know what it is.
DecodingIntuition
Рет қаралды 144 М.
34:28
Fast and Beautiful Assembly
Kay Lack
Рет қаралды 10 М.
34:08
Modify Graph Edge Weights | Leetcode 2699 | Dijkstra Algorithm | Min Heap | Java | Developer Coder
Developer Coder
Рет қаралды 74
12:44
How to Check if a User Exists Among Billions! - 4 MUST Know Strategies
Tech&Career Bytes
Рет қаралды 56 М.
19:52
Think Recursively, Execute Iteratively: Optimizing Dynamic Programming
DecodingIntuition
Рет қаралды 8 М.
23:25
Звуковые иллюзии, которые работают на всех (почти) [Veritasium]
Vert Dider
Рет қаралды 260 М.
41:25
Clone Graph | Leetcode - 133 | Google, Facebook, Amazon | DFS+BFS | Explanation ➕ Live Coding🧑🏻💻
codestorywithMIK
Рет қаралды 8 М.
34:06
Linking can be fast (if you cheat): Roc's Surgical Linker - Brendan Hansknecht
Zig SHOWTIME
Рет қаралды 3,4 М.
00:31
МАИНКРАФТ В РЕАЛЬНОЙ ЖИЗНИ!🌍 @Mikecrab
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 37 МЛН