Please check the code

detecting and removing the loop in linked list

@tharun in the search function, nothing gets returned if key is not present in the list so take care of that.