algorithm function add

test successfully and need to be check the correctness of result
delete some test