title: Time complexity for Shell sort using Knuth's sequence?
body: <p>What is the time complexity of my shell sort implementation?</p>
  
  <pre><code>void shellsort(int items[],int n)   
  {
      int j=1;
      int d = (pow(3.0,j)-1) / 2;
  
      while(d &lt; ceil(n/3))
      {
          for(int i=d;i&lt;n;i++)
          {
              item tmp = items[i];
              int k;
              for(k = i; k &gt;= d &amp;&amp; items[k-d] &gt; tmp; k -= d)
                  items[k]=items[k-d];
              items[k]=tmp;
          }
  
          j++;
          d = (pow(3.0,j)-1) / 2;
      }
  
  }
  </code></pre>