Differences between vector, set, and tuple

  • Vector: Ordered collection of objects of the same type.
  • Set: Unordered collection of objects, possibly of the same type or possibly different depending on the collection type and language. Any given object can only appear once.
  • Tuple: Ordered collection of objects of different types.

A vector is an ordered sequence of items that does allow duplicates.

A set is a collection of items that is unordered and does not allow duplicates.

A tuple is an ordered sequence of items of a given length.