iterative and recursive merge of linked lists