The two termination conditions that you publish are often used depending on whether the low and high are inclusive or exclusive. If your restrictions are enabled, then when low = high, one element remains in the array for verification, and the inner loop should start at another time. Thus, checking whether low & le; high fits. On the other hand, if low is inclusive and high is exceptional, then when low = high, you have exhausted all the elements and you are done, so the form test low <high ββis more suitable.
source share