We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
use kruskal's algorithm to find minimum fare that the weight of edge after which node 1 and node N are connected
for fast implementation use union find data structure with weighting and path compression
below is the the which passes all testcase(and probably faster than editorial)
Jack goes to Rapture
You are viewing a single comment's thread. Return to all comments →
use kruskal's algorithm to find minimum fare that the weight of edge after which node 1 and node N are connected for fast implementation use union find data structure with weighting and path compression below is the the which passes all testcase(and probably faster than editorial)