On the Worst-Case Complexity of TimSort

  title={On the Worst-Case Complexity of TimSort},
  author={Nicolas Auger and Vincent Jug{\'e} and Cyril Nicaud and Carine Pivoteau},
TimSort is an intriguing sorting algorithm designed in 2002 for Python, whose worst-case complexity was announced, but not proved until our recent preprint. In fact, there are two slightly different versions of TimSort that are currently implemented in Python and in Java respectively. We propose a pedagogical and insightful proof that the Python version runs in O(n logn). The approach we use in the analysis also applies to the Java version, although not without very involved technical details… CONTINUE READING
Recent Discussions
This paper has been referenced on Twitter 4 times over the past 90 days. VIEW TWEETS