Here's the gist: https://gist.github.com/Securiteru/a83e4f1a028acd0b1013def793b5dcdc
And the output: ... 60697 61151 61190 61275 61460 61608 61618 61746 61750 61822 62111 62178 62183 62311 62448 62454 62522 62558 62681 62699 62724 62853 62856 62885 62953 62972 63007 63052 63104 63189 63191 63244 63341 63455 63488 63521 63553 63735 63737 63745 63752 63776 63815 63877 63977 64113 64187 64344 64387 64394 64491 64553 64592 64657 64663 64864 64867 64904 64925 65050 65196 65319 65474 mid is: 499 249 124 61 30 14 6 2 0 1 Didn't find needle in haystack.
Basically what I did, if you didn't see in the gist, I asked the program to show me all the elements of the randomly generated array (to ensure it's sorted properly, I think it is) and then the MID after each iteration, I have a question why does 0 precede 1 and why is that? Is it an integer overflow of sorts, is it a code bug, I would appreciate any feedback regarding this issue.