Make a new copy of your lab11a.py file. Name it lab11b.py.
def selection_sort(L): ''' Use the selection sort algorithm to sort a list. Parameter: unsorted list Sorts the original list that was passed to it -- doesn't return anything. ''' pass
Name of input file: cities-small.txt
The original list of cities is:
0: Santa Rosa
1: Petaluma
2: Rohnert Park
3: Windsor
4: Healdsburg
The new list of cities is:
0: Healdsburg
1: Petaluma
2: Rohnert Park
3: Windsor
4: Santa Rosa
Name of input file: cities-small.txt
The original list of cities is:
0: Santa Rosa
1: Petaluma
2: Rohnert Park
3: Windsor
4: Healdsburg
Swapped elements 0 and 4 -- Santa Rosa and Healdsburg
The new list of cities is:
0: Healdsburg
1: Petaluma
2: Rohnert Park
3: Windsor
4: Santa Rosa
Name of input file: cities-small.txt
The original list of cities is:
0: Santa Rosa
1: Petaluma
2: Rohnert Park
3: Windsor
4: Healdsburg
Swapped elements 0 and 4 -- Santa Rosa and Healdsburg
Swapped elements 1 and 1 -- Petaluma and Petaluma
Swapped elements 2 and 2 -- Rohnert Park and Rohnert Park
Swapped elements 3 and 4 -- Windsor and Santa Rosa
The new list of cities is:
0: Healdsburg
1: Petaluma
2: Rohnert Park
3: Santa Rosa
4: Windsor