F5 Networks OA 2022 | Find Critical and Pseudo Critical Edges in Minimum Spanning Tree | Java Solution

Question · Posted Jun 2026

Problem Statement Given a connected, weighted, undirected graph with n nodes numbered from 0 to n-1 and an array edges, where: edges[i] = [ui, vi, weighti] represents an edge between nodes ui and vi having weight weighti. Your task is to classify every edge into one of the following categories: Critical Edge An edge is called critical if removing it causes: The graph to become disconnected, OR The weight of the Minimum Spanning Tree (MST) to increase. Pseudo-Critical Edge An ...

The full answer & interview discussion are available to premium members.

Log in Create a free account