Study Cards on term, collections, stream
The itinerary is a set of locations that the ride must visit.
These have a natural order, the first stop, the second stop, … the last stop.
However, there is no reason why the ride cannot visit some of the same stops more than once (Fig. 10.11).
What two collections are common?
consider sampling the barometric pressure at a location every day at the same time.
The results are ordered, but we allow duplicate measurements values. Similarly, consider the closing values of the stock market over time.
As they are common, it is convenient to refer to them by their collection name of SEQUENCE or SEQ.
Though streams may be sequences, the term stream primarily describes how the elements arrive over time.
The term “bag” is a common name for collections that allow duplicate entries and is the term used within UML. In mathematics, they are also called multisets.
- Higher grades + faster learning
- Don't study anything twice
- 100% sure, 100% understanding