Concept

How do sets differ from arrays and linked lists in order and duplication?

Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk / Chapter 1

"If you’ve done some computer programming, you might see a resemblance between sets and the collections of items often used in a program: arrays, perhaps, or linked lists. To be sure, there are some similarities. But there are also some very important differences, which must not be overlooked: No order. As previously mentioned, there is no order to the members of a set. “{Dad, Mom}” is the same set as “{Mom, Dad}”. In a computer program, of course, most arrays or lists have first, second, and last elements, and an index number assigned to each. No duplicates. Suppose M is the set of all males. What would it possibly mean to say M = {Dad, Dad, T.J. }? Would that mean that “Dad is twice the man that T.J. is”? This is obviously nonsensical. The set M is based on a property: maleness. Each element of Ω is either male, or it isn’t. It can’t be “male six times.” Again, in an array or linked list, you could certainly have more than one copy of the same item in different positions."

Related Ideas

How do sets differ from arrays and linked lists in order and duplication? | Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk | Bifalgorithm | Bifalgorithm