You are given a graph $G=(V, E)$ with positive edge weights, and a minimum spanning tree $T=\left(V, E^{\prime}\right)$ with respect to these weights; you may assume $G$ and $T$ are given as adjacency lists. Now suppose the weight of a particular edge $e \in E$ is modified from $w(e)$ to a new value $\hat{w}(e) .$ You wish to quickly update the minimum spanning tree $T$ to reflect this change, without recomputing the entire tree from scratch. There are four cases. In each case give a linear-time algorithm for updating the tree.
(a) $e \notin E^{\prime}$ and $\hat{w}(e) > w(e)$.
(b) $e \notin E^{\prime}$ and $\hat{w}(e) < w(e)$.
(c) $e \in E^{\prime}$ and $\hat{w}(e) < w(e)$.
(d) $e \in E^{\prime}$ and $\hat{w}(e) > w(e)$.