I am doing a refresher on CS fundamentals.
I have a question on linked lists.
There are some cases that a dummy node is used (in the head of the list mainly) to assist in the implementation.
I see that if it is missing (i.e. if an approach without using a dummy node is followed) the code becomes "messy" (at least I do it messy since I am rusty on these stuff....)
I was wondering are there cases that an algorithm is not possible to be solved without using a dummy node?
Can you give an example?
And are there specific characteristics of the problem at hand that give away that a dummy node is the only way to go?
Note: I don't tag a specific language but just in case my prefered is Java