Arrays v.s. Sets

Here are some short researches that I done to figure out all the difference between arrays and sets

Basics about set operations

https://people.cs.pitt.edu/~milos/courses/cs441/lectures/Class7.pdf

Practically, here are some differences between sets and arrays

  1. No random access of set elements (no notion of index). Array can random access any element.
  2. No notion of ordering, so probably no way to do set1 + set2 for element-wise sum.
  3. Availability of set operations, set1+ set2, union of the two sets. It would be unclear for array.
Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s