Variables in Exchange Sort with CDs
When we acted out Exchange Sort, we used variables as follows:
1. Each student holding a CD represented a variable (a location in memory)
2. Each variable (student) stored a value (a CD)
3. Each time we looked at the name of a CD we were “seeing” the value stored in that variable
4. When two students exchanged CDs, a new value (CD) was stored in each of the variables (students)