Feedback Consider U = N+1 

Forum: Com Sci 221, U Chicago, Autumn 2001, Old Classwork
Re: News Assignment #4 due Monday, 22 October (Mike O'Donnell)
Re: Warning invariant precludes searching for last element (Jesse Dailey)
Date: 2001, Oct 19
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

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.


Messages

to: "Consider U = N+1"