Class 41 — Friday, December 3

Another chance to be a class

Dream big and work hard — Celebrate diversity — Always pay forward


Look both ways


Agenda


Downloads


Test 3


Consider being a TA for CS 1112


Your task


Function consider( cities, tour, i1, i2 )

testing consider()

cities: [(281, 468), (515, 643), (738, 88), (530, 120), (410, 754)]

starting tour: [1, 0, 4, 3, 2]

i1: 2

i2: 4

consider( cities, tour, i1, i2 ): True

current tour: [1, 0, 2, 3, 4]


cities: [(281, 468), (515, 643), (738, 88), (530, 120), (410, 754)]

starting tour: [1, 0, 4, 3, 2]

i1: 1

i2: 3

consider( cities, tour, i1, i2 ): False

current tour: [1, 0, 4, 3, 2]

 


  🦆 © 2021 Jim Cohoon   Resources from previous semesters are available.