What distinguishes between set, multiset and list is whether the order is important or not, and whether repetitions of elements is allowed:
- List: order is important and repetition is allowed
- Multiset: order is not important but repetition is allowed
- Set: order is not important and repetition is not allowed
My question is: What's exactly the difference between list and sequence? A sequence is also a collection of elements that their order is important and repetition is allowed. These two terms (list and sequence) are usually used in different domains, but I wanted to know if there is any conceptual difference between them.
I got this question when I saw the Wikipedia entry on sequence. It says: "In mathematics, a sequence is an ordered list." Since by definition, lists are ordered, the word "ordered" is redundant in "ordered list" and may be misleading for some people because they may conclude that there exist unordered lists. I wanted to correct this and write "a sequence is a list", but first wanted to make sure if there is any difference other than the domains where these terms are used.
P.S. These terms (list and sequence) may have different meanings in some programming languages, but that's not what I'm looking for here.
P.S.2 Some may say the difference is that a list is a data structure while a sequence is not. But that's just the definition of a list in Data Structures, here I'm referring to the mathematical concept of list (i.e. a collection of objects whose orders are important and repetition is allowed).