online advertising

Thursday, November 19, 2015

Algorithms: Design and Analysis, Part 1 - Programming Question 5

Problem:

Find the shortest paths in a undirected weighted graph with 200 nodes.

Solution:

Straightforward implementation of the Dijkstra's algorithm.

As usual, I had a bug (forget to recursively call FixDown). Brute force comparison and asserting heap invariant helped me to find and fix the bug.


No comments:

Post a Comment