Fixed several off-by-one bugs that gave wrong answer

Details:
  - Made algo1 iterate to end of array
  - Algo3 wasn't returning the right answer when the maxLeft included
the midpoint
  - Adjusted array end points in algo3

We should always get the right answer now