Xilinx

  www.xilinx.com
  www.xilinx.com

Interview Question

Staff Software Engineer Interview San Jose, CA

describe the shortest path of a graph with negative weights

Answer

Interview Answer

1 Answer

0

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.