DarkSilver's blog

By DarkSilver, history, 3 weeks ago, In English

Given a directed graph, source node and destination node you have to start from source with value 1 and reach destination node along some path where each edge has a multiple associated with it. Find the maximum value you can attain? Assume, if cycles exists it does not increases value to greater than 1.

Can we use Dijkstra's algorithm here or a quadratic dp+dfs is more appropriate?

Full text and comments »

  • Vote: I like it
  • +10
  • Vote: I do not like it

By DarkSilver, history, 5 weeks ago, In English

While I was trying to solve a problem that given a network of people prove that any two people are separated by a distance of 6 or less. I tried pondering on any sub-quadratic solution by finding maximum shortest distance in a graph. Are there any common know methods to find diameter of graph?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By DarkSilver, history, 4 months ago, In English

I had a problem asked to me recently. Given a 2D matrix where '#' represent blocked cell and '.' represent available cells and exit point E. How would you create a set of instructions (Top, Down, Left, Right) that it is always possible to reach exit cell no matter where you start in matrix(it is always possible to reach exit cell from '.')

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it