Re: time complexity



On 2005-06-27, gauravbjain@xxxxxxxxx <gauravbjain@xxxxxxxxx> wrote:
> Consider this...
>
> int h = n;
> int i;
>
> while ( h > 0 )
> {
> for(i=0;i<h;i++)
> {
> printf("%d",i);
> }
> h =/ 2;
> }
>
> What should be the complexity of this peice of code...
>
> Regards,
> Gaurav
>
The same complexity as an easy piece of homework.
.



Relevant Pages

  • Re: Play Wales Bin
    ... dragged upwards by a couple of manager types who are in their 40s; ... int main ... You wanted needlessly verbose comments everywhere? ... complexity of the code. ...
    (uk.games.video.misc)
  • Re: CSpinControl/CEdit relationship
    ... Actually that complexity is what Im banking on, ... calculations that need to be redone based on the value of the int in that ... The int is part of a calculation that I want to recalc every ... > for what you want to do (get the edit control value and then update ...
    (microsoft.public.vc.mfc)
  • RE: highest value in a an array
    ... Wibberlet wrote: ... Its complexity is Ohowever, ... foreach (int value in integerArray) ... Jon Skeet - ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Small Correction: Convert HEX string to bin
    ... Dan Pop wrote: ... >> Instead of all the complexity, and assuming that the OP will not ... >>int unhexify ... > It has the same bug that I deliberately left unfixed in my ...
    (comp.lang.c)
  • time complexity
    ... int h = n; ... What should be the complexity of this peice of code... ... Regards, ... Gaurav ...
    (comp.theory)