Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between vector, set, and tuple

What are the differences between vectors, sets, and tuples in programming?

like image 779
RCIX Avatar asked Jun 09 '09 22:06

RCIX


People also ask

What is the difference between tuple and set?

Tuple is a collection of values separated by comma and enclosed in parenthesis. Unlike lists, tuples are immutable. The immutability can be considered as the identifying feature of tuples. Set is an unordered collection of distinct immutable objects.

Can a tuple be a vector?

What is Vector of Tuple? A tuple is an object that can hold a number of elements and a vector containing multiple number of such tuple is called a vector of tuple. The elements can be of different data types. The elements of tuples are initialized as arguments in order in which they will be accessed.

What is a vector set?

A vector space is a set that is closed under addition and scalar multiplication. Definition A vector space (V, +,., R) is a set V with two operations + and · satisfying the following properties for all u, v 2 V and c, d 2 R: (+i) (Additive Closure) u + v 2 V . Adding two vectors gives a vector.


1 Answers

  • 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.
like image 117
RichieHindle Avatar answered Sep 23 '22 05:09

RichieHindle