• + 1 comment

    Hey could you explain why this works? because I put a print statement right at the end of the loop after "temp = temp.prev" and it gave me a nullpointer exception. However, when i put that print statement at the start of loop, there was no error; could you give some sort of explanation of this algorithm? thanks.