← Cognizant questions
CodingReported in a candidate post, Aug 2023

Shortest path in a weighted graph using Dijkstra's algorithm

Filed under Cognizant

Given a weighted graph with non-negative edge weights and a source node, find the shortest path from the source to all other nodes using Dijkstra's algorithm.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Cognizant questions

Collected from public candidate posts and coding forums. Updated Nov 2026.