- Assumptions:
- collection L of data of type T
- can iterate through L ("begin", "next", "end")
- Outcomes:
- decide whether t is in L
- return boolean (yes/no)
- Proof: (postponed)
|
- Body (written in pseudocode):
T item = begin(L);
while (item is in L)
{
if (t == item)
return true;
item = next(L);
}
return false;
|