Iterative Approach

Can we solve it iteratively? If yes,then what would be the approach?

hi @Shivam_Dureja, refer

In the above link, they are swapping node values not the actual nodes. But in the given scenario we need to swap the nodes. So how could we do this iteratively?

@Shivam_Dureja, here u go https://www.geeksforgeeks.org/swap-nodes-in-a-linked-list-without-swapping-data/

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.