Add search() mechod by BFS, return the reference of node when visit func is True