Improved LinkedStack and LinkedQueue.