finish link list related algorithm