Skip to content

Instantly share code, notes, and snippets.

View pinmons's full-sized avatar
🎯
Focusing

cris pinmons

🎯
Focusing
View GitHub Profile
@AtonCode
AtonCode / dijkstra_algorithm.cpp
Last active January 16, 2024 21:30 — forked from nateshmbhat/dijkstra_algorithm.cpp
Dijkstra Algorithm for finding shortest path to all vertices from a single source.
//Algoritmo de Dijkstra, el Camino mas Corto
//Fork de Dijkstra por: nateshmbhat https://gist.github.com/nateshmbhat/1a79daa00a148e44ad79c3e338977440
//Fork de nateshmbhat por: Alejandro Sacristan Leal https://gist.github.com/AtonCode/acd3077fa70a2cbb6fcbe211a206c4dd
//
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
@nateshmbhat
nateshmbhat / dijkstra_algorithm.cpp
Created April 28, 2020 04:41
Dijkstra Algorithm for finding shortest path to all vertices from a single source.
#include<bits/stdc++.h>
using namespace std ;
int cost[100][100] , n ;
int getMin(int dist[] , bool visited[]){
int key = 0 ;
int min = INT_MAX ;
for(int i=0;i < n ; i++){
if(!visited[i] && dist[i]<min){