Hey guys,
I'm doing some exercises for Algorithms Complexity and thing is I'm stuck.
I can't find to understand what this is supposed to do :
Any idea ?Code:s = sum(K=0 ... N-1) a[k]
Thanks.
Hey guys,
I'm doing some exercises for Algorithms Complexity and thing is I'm stuck.
I can't find to understand what this is supposed to do :
Any idea ?Code:s = sum(K=0 ... N-1) a[k]
Thanks.
It looks like an attempt to render summation notation, i.e., sum of a[k] from k=0 to k=n-1. Translating it to C would likely involve a for loop.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
It it inside a while loop
Ah well, it amounts to the same thing, though I still think that a for loop would be more idiomatic when converting from summation notation.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)