title: Program occurrences that counts digits, white spaces and other stuff what's best,average and worst case
body: <pre><code>main() 
  {
      int c, i , nwhite, nother;
      int ndigit[10];
      
      nwhite = nother = 0;
      
      for(i = 0; i&lt;10; ++i)
      {
          ndigit[i] = 0;
      }
      
      while((c = my_getchar(ndigit,nwhite,nother)) != EOF)
          if(c &gt;= '0' &amp;&amp; c &lt;= '9')
              ++ndigit[c-'0'];
          else if (c == ' ' || c == '\n' || c == '\t')
              ++nwhite;
          else
              ++nother;
              
      
  }
  </code></pre>
  <p>so this is code from book, what's the best, average and worst case for increment itterations. for best case I realized that it's O(1) like when you have one input you always get only one increment but how about worst and average cases I am getting confused. Like whats worst and average case for increment operations in this code as you see ++ndigit, ++nwhite and ++nother are increment operations and I am wondering am I correct about best case? I would like to get little help with best average and worst cases for this increment operations.</p>