C++ Coding Question
Generic Queue implementation. Start with something like this:
1 2 3 4 5 6 7 8 9 10 11 |
#include <iostream.h> using namespace std; template <class T> class MyQueue { public: void put(T const &); T get(); }; |
Please make your code threadsafe, have O(1) efficiency and you can’t import anything (other than of course iostream) Good luck!