use bfs to build_map, same_iterative.cpp has a bug

Signed-off-by: xbz <xbz.o3sig@gmail.com>