title: Writing a permutation function
body: <p>I've been asked to write a permutation function that uses recursion. The only parameter of the function should be the string that I should find all the permutations of. The function should return a vector with all possible permutations. I know I can use <code>next_permutation</code> in STL Algorithms, but I've been asked not to.</p>
  
  <p>I have the base case set up, and I know I need a for loop, but I'm not quite sure where to go from there. Can someone point me in the right direction?</p>
  
  <pre><code>vector &lt;string&gt; getPerm(string str)
  {
      vector&lt;string&gt; v;
      if(w.length() &lt;= 1)
      {
          v.push_back(str);
          return v;
      }
      else
      {
          for(int i = 0; i &lt; str.size(); i++)
          {
              //Some code
          }
      }
  }
  </code></pre>
  
  <p>Any help would be appreciated.</p>