title: Efficient way to rotate array clockwise and counterclockwise
body: <p>I am rotating an array or vector clockwise and counterclockwise in C++. Which is the most efficient way in terms of time complexity to do that ? 
  I used rotate() function but I want to know is there any faster methods than this ?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  using namespace std;
  
  int main()
  {
     vector&lt;int&gt; v;
     for(int i=0;i&lt;5;i++)
        v.push_back(i);
     int d=2;
     rotate(v.begin(),v.begin()+d,v.end());
     return 0;
  }
  </code></pre>