Menu
Coddy logo textTech

Final Challenge #2

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

challenge icon

Challenge

Easy

One more union-find application.

Write a function named isConnected that takes n and the flat edges array (triples, undirected) and returns 1 if the whole graph is a single connected component, or 0 otherwise.

A connected graph is exactly one where an MST can span every vertex.

Try it yourself

#include <stdlib.h>

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

All lessons in Kruskal's Algorithm - Graph Algorithms