diptangsu / Sorting-Algorithms

Sorting algorithms in multiple languages.
156 stars 165 forks source link

Timsort.py gets IndexError on larger arrays #205

Open wkvolkman opened 9 months ago

wkvolkman commented 9 months ago

Also left and right seem to be swapped, result works just nomenclature.

len1, len2 = m - l + 1, r - m
if l + len1 > len(arr):
   len1 = len(arr) - l