Reversing single linked list in C#

That question gets asked a lot. When I was asked it in my interviews many years ago, I reasoned as follows: a singly-linked list is essentially a stack. Reversing a linked list is therefore a trivial operation on stacks: newList = emptyList; while(!oldList.IsEmpty()) newList.Push(oldList.Pop()); Now all you have to do is implement IsEmpty and Push … Read more

How to reverse a singly linked list using only two pointers?

Any alternative? No, this is as simple as it gets, and there’s no fundamentally-different way of doing it. This algorithm is already O(n) time, and you can’t get any faster than that, as you must modify every node. It looks like your code is on the right track, but it’s not quite working in the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)