Searching in the linked list

I think that the iterative approach to search the element is wrong here since we are using temp in while loop but incrementing head so it will go into infinite loop.
is this correct or not ?

hi @jaichaturvedi1861_8ca88690b823e07a yeah its wrong, temp should be used inside also