I will ask you to classify each edge in a weighted undirected graph. For every edge, decide whether it appears in every minimum spanning tree (MST), in at least one MST, or in no MST.
A standard solution sorts edges by weight, processes one weight group at a time, and builds a temporary graph of the current disjoint set union (DSU) components. If an edge connects two vertices already in the same component, it is in no MST. Among edges that connect different components, the bridges of the temporary graph are in every MST and the rest are in at least one MST. This runs in time and uses space.