type def
implement
4-2 init
using DFS
construct visited as false