title: Which data structure is best for basic stacks and queues in C++?
body: <p>I'm doing some newbie HackerRank problems in C++ and I'm finding that there seems to be several ways to solve this problem and I'm wondering which way is most widely used and/or most efficient. The problem requires creating a class that contains both <code>stack</code> and <code>queue</code> variables as well as <code>stack_push</code>/<code>stack_pop</code> and <code>queue_push</code>/<code>queue_pop</code> functions for them. </p>
  
  <p>From what I've googled it seems I could either use <code>std::vector</code>, <code>std::stack</code> and <code>std::queue</code>, or <code>std::deque</code>, and maybe others. </p>
  
  <p>I'm not sure how to determine which is best to use. Any suggestions?</p>
  
  <p>EDIT:
  I implemented using <code>std::vector</code> for both and then using <code>std::stack</code> along with <code>std::queue</code> and I saw the same exact performance with both for a small-ish test case.
  EDIT2:
   With a much bigger test case it looks like <code>std:stack</code>/<code>std:queue</code> outperforms <code>std:vector</code>. I'm guessing this is because of the FIFO queue half not being efficient with a vector, but I'll need to test this out more.</p>