Time Complexity Confusion!!!

Правка en1, от aman_naughty, 2019-06-13 22:02:09

Why does this code get accepted 55539853 and this does not 55539543?

I believe the time complexity of 1st submission is O(k(n+m)) for k bfs and then O(nklog(k)) for sorting each node.

Can someone tell the complexity of the second code because of which it is failing.

For getting s smallest element I am using slog(s) complexity in bfs in 2nd submission.

Теги #graph, #dfs and similar, #running time, analysis

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский aman_naughty 2019-06-13 22:02:09 416 Initial revision (published)