manan025 / DS-Algo-Zone

This repository contains codes for various data structures and algorithms in C, C++, Java, Python, C#, Go, JavaScript and Kotlin.
MIT License
25 stars 78 forks source link

shortestpath #166

Open shubhamnag14 opened 3 years ago

shubhamnag14 commented 3 years ago

shortest path from one node to another node in an unweighted graph using breadth first search pitch the complexity of this algorithm: o(v+e) complexity of dijkstra algorithm: o(v^2) when unoptimized, or o(v + e log v) when optimized using priority queue. this algorithm is faster than the popular dijkstra algorithm, and is also far simpler, as it only uses a breadth first search in github