Find the lowest positive value from an array

Pages: 12
You can shove a boolean flag in my algorithm to find out if it's returned that value because it's a negative or because it's the maximum integer.

Simples.
The bottom line is that you have to change the code to have the function do something else. Since this is as true for Vlad as any other poster, I really don't see the point of criticizing an algorithm simply because changing it requires changing a specific portion of the code.

The real draw of Vlad's code is that the same error condition can be used for any such function.
Topic archived. No new replies allowed.
Pages: 12