Which data structure supports the following four types of queries?
Given an undirected graph $$$G=(V, E)$$$, there are four types of queries, and these queries may be asked in an arbitrary order:
(1) Add an edge $$$e$$$ to $$$E$$$. It is guaranteed that $$$e \notin E$$$ before this query.
(2) Delete an edge $$$e \in E$$$. It is guaranteed that $$$e \in E$$$ before this query.
(3) Query the number of connected components in $$$G$$$.
(4) Check whether vertices $$$u$$$ and $$$v$$$ are in the same connected component.