Skip to main content
1 vote
Accepted

sort_pairs function not working as per check50

I think you're trying to use bubble sort, since you're swapping pairs[i] and pairs[j] if pairs[j] is stronger than pairs[i]. However, bubble sort always swaps adjacent elements, and i and j aren't ...
Llenk's user avatar
  • 744
1 vote
Accepted

Pset3: Tideman - Sort_pairs function

check50 doesn't care about how you implemented add_pairs when it's testing sort_pairs, so it doesn't initialize the winsize property. You'll need to remove that property, and access it in sort_pairs. ...
Llenk's user avatar
  • 744

Only top scored, non community-wiki answers of a minimum length are eligible