CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: laserlight

Search: Search took 0.19 seconds.

  1. Replies
    15
    Views
    17,202

    Re: [RESOLVED] Big-Oh Notation Question

    You did not say that. Rather, you asked if "the complexity of the inner loop is O(2^n)". It isn't, as you yourself have now concluded. What you probably have in mind is the idea that the value of...
  2. Replies
    15
    Views
    17,202

    Re: Big-Oh Notation Question

    If that were true, then this C++ program:

    #include <iostream>

    int main()
    {
    int n = 5;
    for (int count = 1; count < n; count++)
    {
    int count2 = 1;
  3. Replies
    15
    Views
    17,202

    Re: Big-Oh Notation Question

    Not quite: notice that count2 is doubled, not incremented, on each iteration of the inner loop. As such, what is the complexity of the inner loop?
Results 1 to 3 of 3





Click Here to Expand Forum to Full Width

Featured