#include <bits/stdc++.h>
using namespace std;
const int MAX_EDGE = 10000;
const int MAX_VERTICES = 100;
struct Edge{
int len, v, last;
} edge[MAX_EDGE];
bool vst[MAX_VERTICES];
int latest_edge_of_u[MAX_EDGE], eid;
void init(){
memset(latest_edge_of_u, -1, latest_edge_of_u);
for(int i = 0 ; i < MAX_VERTICES ; i++){
vst[i] = false; //开始默认没有访问过
}
eid = 0;
}
void insert(int w, int u, int v){
if(w){ //权值不为0,该边存在
edge[u].v = v;
edge[u].len = w;
edge[u].last = latest_edge_of_u[u];
latest_edge_of_u[u] = eid++;
}
}
void dfs(int start){
vst[start] = true;
previsit(start); //前序访问该结点
for(eid = latest_edge_of_u[start] ; eid != -1 ; eid = edge[eid].last){
if(!vst[edge[eid].v]){
dfs(edge[eid].v);
}
}
postvisit(start); //回溯访问该结点
}
int main(){
init();
//
return 0;
}