Warning invariant precludes searching for last element 

Forum: Com Sci 221, U Chicago, Autumn 2001, Old Classwork
Re: News Assignment #4 due Monday, 22 October (Mike O'Donnell)
Date: 2001, Oct 19
From: Jesse Dailey jldailey

according to part of the invariant:

(for all J s.t. U <= J <= N )( X[J] > T )

this implies that we cannot search for the case where X[N] = T.

since any value of X[N] must be strictly > T.

this leads to erroneously stating that B is equal to the next
to last element when you search for the last element.


Messages

1. Feedback Consider U = N+1 by Mike O'Donnell, 2001, Oct 19

to: "invariant precludes searching for last element"