Something was listening to me, since I heard that a lot was asked in the interview. Separate reverse list. The thing is, I checked the implementations, and I was wondering if the idea I was thinking about could be applied
|data1|->|data2|->|data3|->|data4|->|data5|
This structure is the initial condition for a linked list. I thought when we would like to reverse, right.
|data5|->|data4|->|data3|->|data2|->|data1|
So in a loop that will take O (n) runtime , just changing the data of Node # 1 to Node # 5 , will Node # 2 with Node # 4 do the job?
source
share