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.
Kruskal (MST): Really Special Subtree
Kruskal (MST): Really Special Subtree
Sort by
recency
|
190 Discussions
|
Please Login in order to post a comment
As a hint to anyone stuck on a difficult test, I would recommend a couple of things: 1. consider what properties of the graph would make you would choose Kruskal's over Prim's algorithm for MST. 2. If the greedy solution does not give the MST, then is the graph really undirected? And if the graph is not undirected, how would you solve the more generalized MST algorithm: while tree does not form a spanning tree, find an edge that is safe for the tree and add it to the tree.
Can you modify Prim's for the later?
I would post more details, but the platform asks us not to post solutions...
What is wrong with mys solution - ? public static int kruskals(int gNodes, List gFrom, List gTo, List gWeight) { var edges = new List>(); for (int i = 0; i < gFrom.Count; i++) { edges.Add(new Tuple(gFrom[i], gTo[i], gWeight[i])); }
}
VoIP technology is continuously evolving, with ongoing advancements in features, capabilities, and integration options. Providers are constantly innovating to incorporate emerging technologies such as Artificial Intelligence (AI), machine learning, and advanced analytics into their VoIP systems. This commitment to innovation ensures that VoIP services remain at the forefront of communication technology VoIP Phone Services, offering businesses and individuals access to the latest tools and solutions to stay competitive and adapt to future developments.
C++ (more at https://github.com/IhorVodko/Hackerrank_solutions/tree/master , feel free to give a star:) )
My python solution