Add the impl of search algorithm