Please share the code I want to know the approach

Please share the code

you have to use 3 pointer curr,prev,nxt
and manipulate the pointers so that they point in reverse order
Reference Code