1.顺序表用于图的深度优先遍历 public class SeqList { public final int MaxSize = 10; public Object list[]; public int size; /** * 初始化 */ public SeqList() { list = new Object[MaxSize]; this.size = 0; } /* public SeqList initSeqList(SeqList seqList) { seqList.list =…
//归并排序递归方法实现 #include <iostream> #include <cstdio> using namespace std; #define maxn 1000005 int a[maxn], temp[maxn]; long long ans; void MergeSort(int a[], int l, int mid, int r) { ; int i = l, n = mid, j = mid, m = r; while ( i<n &&am…