Why this function isn't working

Why this function isn’t working.
I have written detailed explanation below in codetoo.

Hey @cbcao263
Again I dont think both of them are matching :neutral_face:

It is actually same.
Implement a singly linked list having all unique elements with the following operations.

This is what I am doing

Hey @cbcao263
Reolace line 119 by

int pos=(first+last)/2+1;

Sir, It’s not working in CB Ide.
Shyd Infinite loop mein jaarha

This is the Question
Please check asap.

Working on my personal IDE ,CB Ide p koi technical issue hoga

Yes Sir, It’s working.
Sir UxP function smjh nhi aarha
.Usko kaise krenge

Hey
What I can think of is try using hashmaps with brute force approach.
Save all the nodes with data as key and ref as value and then do what function is asking by traversing from that reference towards right

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.