Searching string for character in binary search

ag0aep6g anonymous at example.com
Sun Feb 25 21:29:13 UTC 2018


On 02/25/2018 10:18 PM, Joel wrote:
>              if (arr[i]  > n)
>                  arr = arr[i + 1 .. $];

When `arr[i]` is greater than `n`, then the values in `arr[i + 1 .. $]` 
will only be even greater. You're picking the wrong half of the array.


More information about the Digitalmars-d-learn mailing list