Watch this Author's files
Both works fine for me.
Thanks a lot for sharing. I tested the code accordaing to an example in a recent published book http://www.engr.colostate.edu/~echong/book3/ & the results were identical.
In the case of maximisation, would you only swap ''<'' in line 41 with ''>'' ?