Xilinx Interview Question: describe the shortest path of... | Glassdoor

Interview Question

Staff Software Engineer Interview San Jose, CA

describe the shortest path of a graph with negative weights


Interview Answer

1 Answer


if it's a DAG, then we can solve it in O(n) using topological sorting. For a general directed graph, we can use bellam ford to solve it or find a negative cycle in O(mn).

Anonymous on Apr 5, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.