added partition function and delete node with no head of list to linked list