partition a linked list