Add search() mechod, return the reference of node when visit function is True