Google-DSC-TMSL / ProjectAlgorithms

A place where you can find solutions to the most asked interview questions
https://github.com/Google-DSC-TMSL/ProjectAlgorithms
MIT License
12 stars 35 forks source link

Create Implementing-Dijkstra-Algorithm.cpp #52

Closed Manali0806 closed 2 years ago

Manali0806 commented 2 years ago

Question Implementing Dijkstra Algorithm Given a weighted, undirected and connected graph of V vertices and an adjacency list adj where adj[i] is a list of lists containing two integers where the first integer of each list j denotes there is edge between i and j , second integers corresponds to the weight of that edge . You are given the source vertex S and You to Find the shortest distance of all the vertex's from the source vertex S. You have to return a list of integers denoting shortest distance between each node and Source vertex S.

Note: The Graph doesn't contain any negative weight cycle. Question Link - https://practice.geeksforgeeks.org/problems/implementing-dijkstra-set-1-adjacency-matrix/1 Youtube Link - https://youtu.be/SQ-pXKsBBz8