func FindOrderDFS(g *graph.Graph) ([]int, error) {
	s := stack.New()
	statusList := make([]status, g.NumVertexes())
	for i := 0; i < g.NumVertexes(); i++ {
		if statusList[i] == blank {
			if err := dfs(i, g, s, statusList); err != nil {
				return nil, err
			}
		}
	}
	ret := make([]int, s.Len())
	copy(ret, s.Slice())
	mid := len(ret) / 2
	for i := 0; i < mid; i++ {
		ret[i], ret[len(ret)-i-1] = ret[len(ret)-i-1], ret[i]
	}
	return ret, nil
}
// FindOrderDFS solves ch04-p07

FindOrderDFS solves ch04-p07
// FindOrderDFS solves ch04 - p07
func FindOrderDFS(g *graph.Graph) ([]int, error) {
	s := stack.New()
	statusList := make([]status, g.NumVertexes())
	for i := 0; i < g.NumVertexes(); i++ {
		if statusList[i] == blank {
			if err := dfs(i, g, s, statusList); err != nil {
				return nil, err
			}
		}
	}
	ret := make([]int, s.Len())
	copy(ret, s.Slice())
	mid := len(ret) / 2
	for i := 0; i < mid; i++ {
		ret[i], ret[len(ret)-i-1] = ret[len(ret)-i-1], ret[i]
	}
	return ret, nil
}
func FindOrderDFS ( g * graph . Graph ) ( [ ] int , error ) { s := stack . New ( ) statusList := make ( [ ] status , g . NumVertexes ( ) ) for i := 0 ; i < g . NumVertexes ( ) ; i ++ { if statusList [ i ] == blank { if err := dfs ( i , g , s , statusList ) ; err != nil { return nil , err } } } ret := make ( [ ] int , s . Len ( ) ) copy ( ret , s . Slice ( ) ) mid := len ( ret ) / 2 for i := 0 ; i < mid ; i ++ { ret [ i ] , ret [ len ( ret ) - i - 1 ] = ret [ len ( ret ) - i - 1 ] , ret [ i ] } return ret , nil }
FindOrderDFS solves ch04-p07
FindOrderDFS solves ch04 - p07