Solution of Linked list problems