|
This is just the sort of detailed reasoning that you need to do with the invariant. But in this case you didn't get it exactly right. When U=N+1, the second clause of the invariant is true trivially, even when X[N]<=T. The invariant doesn't say that U<=N, it just says something about the values of I, if any, that lie in between. Mike O'D. |
to: