What do you want to save?
Add Code snippet
New code examples
-
-
Python 2021-11-05 11:19:10
how to find closest distance for given points
# A divide and conquer program in Python3 # to find the smallest distance from a # given set of points. import math import copy # A class to represent a Point in 2D plane class Point(): def __init__(self, x, y): self.x = x self.y = y # A u... Add solution -
-
Python 2021-09-23 16:25:05
dijkstra implementation with the help of priority queue in python
import heapq def calculate_distances(graph, starting_vertex): distances = {vertex: float('infinity') for vertex in graph} distances[starting_vertex] = 0 pq = [(0, starting_vertex)] while len(pq) > 0: current_distance, current... Add solution -
Best helpers
Arad
+5
JoshuaFicy
+5
Majte
+5
Entrepreneur
+5
Meital Regev
+5
Shenkwen
+5
Digcoal
+5
A G Davey
+5
NeuronQ
+5
Emmet
+5
Muazam
+5
Vigrond
+5
Scoiattolo
+5
Erica Price
+5