Menu
Coddy logo textTech

Final Challenge #1

Lesson 8 of 9 in Coddy's Kruskal's Algorithm - Graph Algorithms course.

challenge icon

Challenge

Medium

The single most expensive edge in an MST is its bottleneck.

Write a function named maxEdgeInMST that takes n and the flat edges array (triples, undirected, connected) and returns the largest edge weight that Kruskal's algorithm adds to the MST.

For example, if the MST uses edges of weight 1, 2, and 3, the answer is 3.

Try it yourself

#include <stdlib.h>

int maxEdgeInMST(int n, int* edges, int edges_size) {
    // Write code here
    return 0;
}

All lessons in Kruskal's Algorithm - Graph Algorithms