写一个图的算法(一)
删除图中的节点
删除6结点
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
public class DeleteNode{
/* static List<LinkedList<Integer>> templist; */
static List<LinkedList<Integer>> totallist;
static List<LinkedList<Integer>> Normallist;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
totallist = new ArrayList<LinkedList<Integer>>();
Normallist = new ArrayList<LinkedList<Integer>>();
for(int i=0;i<N;i++) {
totallist.add(new LinkedList<Integer>());
Normallist.add(new LinkedList<Integer>());
}
for(int i=0;i<M;i++) {
int s = sc.nextInt();
int e = sc.nextInt();
/*