pat advance 1075 added, list and map cannot use sort algorithm
pat advance 1076 added, dfs visited must update before put into the queue, ensure each node can be input into the queue only once