Meta interview question

reverse linked list

Interview Answer

Anonymous

Aug 4, 2011

What did you think it ended with, a rainbow? :) You didn't say whether it was a doubly or singly linked list. In either case, it doesn't necessarily terminate with a NULL. It could link back to the first element. That is often done with doubly linked lists to make the insertion/removal operation more efficient.