INPUT: weighted undirected graph in the form of adjacency listOUTPUT: adjacency list without the edge eNaive approach is:for(int i = 0; i < adj.get(e.s).size(); i++) { // loop through adjacent of s  if(adj.get(e.s).get(i).v == e.t) {           // find t and remove it    adj.get(e.s).remove(i);     break;  }}for(int i = 0; i < adj.get(e.t).size(); i++) { // loop through adjacent of t  if(adj.get(e.t).get(i).v == e.s) {           // find s and remove it    adj.get(e.t).remove(i);     break;  }}O(k) - k is number of adjacent verticesA faster approach is to use adjacencyMatrix but my algorithm has alot of traversals involved and looping through each dimension in the adjMat costs more despite a O(1) edge removal.How can I speed up removing an edge? (used in generating a MST (kruskal))
Remove Edge From Adjacency List
graphs;minimum spanning tree;adjacency matrix