I'm looking at some interview questions, and one of them asks to reverse a linked list that contains a cycle. So suppose I had a linked list like the following:
F <- E
| /\
V |
A -> B -> C -> D
Then reversing the list would create the following:
F -> E
/\ |
| V
A <- B <- C <- D
The problem here is that there's a conflict between which nodes C should be pointing at. So would we just eliminate the link between C and F?