Stack and Queue implementation in C++