Prim's Algorithm for Creating a Minimum Spanning Tree (MST) - Min Cost to Connect Points (LC 1584)

preview_player
Показать описание
FAANG Coding Interviews / Data Structures and Algorithms / Leetcode
Рекомендации по теме
Комментарии
Автор

Master Data Structures & Algorithms For FREE at AlgoMap.io!

GregHogg
Автор

I remember after learning this in algos class the professor mentioned offhand that a maze is just a spanning tree so you can use this algorithm to generate a random Maze. After thinking about it for a little bit it blew me away

CoolExcite
Автор

very good . now make it to understand a 5 year old

rohitraj-dfqs
Автор

Just create the maximal tree and find the distances using dijkstra's.

markusklyver
Автор

Please, don’t use hashsets when the domain of the problem has a defined size. Use a list of bools of size N

Tmplar
Автор

insufficient information. you need to explain better, in detail

omkarsheral