Pergunta de entrevista da empresa Google

Given a file that represent a graph, write an algorithm that compute the number of triangles in the graph.

Respostas da entrevista

Sigiloso

11 de mai. de 2015

What about running a DFS on every node looking for an egde that connects to the original vertex in the third depth? Running time would be O (n2 + nm) )

1

Sigiloso

19 de mar. de 2015

I didn't finished this one.

Sigiloso

23 de mar. de 2015

What about running BFS and check how many edges connect nodes on the same level.