Menu
Coddy logo textTech

Final Challenge #1

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

challenge icon

Challenge

Medium

The 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 Prim adds to the MST.

For example, if Prim's tree 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 Prim's Algorithm - Graph Algorithms