Angad Sandhu
Search
Browse

1584_Min_Cost_to_Connect_All_Points

Source name
1584_Min_Cost_to_Connect_All_Points.py
# File: Leetcode/Solutions/1584_Min_Cost_to_Connect_All_Points.py

"""
Problem Number: 1584
Problem Name: Min Cost to Connect All Points
Difficulty: Medium
Tags: Graph, Minimum Spanning Tree, Kruskal, Prim, Neetcode 150
Company (Frequency): Amazon, Google, Facebook, Microsoft, Apple
Leetcode Link: <https://leetcode.com/problems/min-cost-to-connect-all-points/description/>

DESCRIPTION

Given points on 2D plane, cost to connect two points is Manhattan distance; return minimum total cost to connect all points (MST).
Approaches:

* Prim's algorithm O(n^2) or optimized Prim/Kruskal with edges O(n^2 log n).
"""

Browse the library