Search:

Type: Posts; User: cyberfish

Search: Search took 0.04 seconds.

  1. Replies
    24
    Views
    25,681

    Problem with that is, you won't know how to come...

    Problem with that is, you won't know how to come up with the solution in the first place when you see a new problem, which is usually the hardest part. Not the implementation of an algorithm already...
  2. Replies
    24
    Views
    25,681

    Does it actually work? doesn't look like what you...

    Does it actually work? doesn't look like what you described in the first post to me.

    *edit*
    nvm I see it does. You can save one iteration by making it


    for(int i=length-1; i > 1; i--)
    ...
  3. Replies
    24
    Views
    25,681

    Please don't write complete code for people. They...

    Please don't write complete code for people. They don't learn much this way.

    It's even worse if it's homework.
  4. Replies
    24
    Views
    25,681

    Almost. BTW, it's usually not a good idea to...

    Almost.

    BTW, it's usually not a good idea to use sizeof to determine array length, since it won't work for dynamically allocated arrays or arrays passed into functions (you will just get the size...
  5. Replies
    24
    Views
    25,681

    Think about how you would do it by hand, then...

    Think about how you would do it by hand, then write it as C++ statements (no loop), then try to find a pattern into those statements, and turn them into a loop.
Results 1 to 5 of 5