You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an empty set seen, then step through the elements of seq.
Every time we see a number, we check if it's already in seen.
If it is, we say the list is not unique.
Otherwise, we add the element to seen and continue.
If we reach the end and haven't seen any duplicate elements, we say the list is unique.
Our decision should match the operator IsUnique(seq).
In this chapter we'll focus on just writing out the spec, parts (2) and (3). In the next chapter we'll do steps (1) and (4), actually verifying the algorithm.
But the example plainly does do steps 1, 2, 3. Does the segment
In this chapter we'll focus on just writing out the spec, parts (2) and (3). In the next chapter we'll do steps (1) and (4), actually verifying the algorithm.
perhaps refer to an earlier list of activities that the user is to do?
problem statement
Suggest that IsUnique(seq) is a misleading name, and that something like ContainsNoDuplicates(seq) expresses the intent better. Similarly, if we reach the end and haven’t seen any duplicate elements, we might better say the elements of the list isare unique.
The text was updated successfully, but these errors were encountered:
Description
The writing specifications page says this of the duplication checker:
But the example plainly does do steps 1, 2, 3. Does the segment
perhaps refer to an earlier list of activities that the user is to do?
problem statement
Suggest that
IsUnique(seq)
is a misleading name, and that something likeContainsNoDuplicates(seq)
expresses the intent better. Similarly, if we reach the end and haven’t seen any duplicate elements, we might better say the elements of the listisare unique.The text was updated successfully, but these errors were encountered: