https://hal.inria.fr/hal-01184796Janson, SvanteSvanteJansonDepartment of Mathematics [Uppsala] - Uppsala UniversitySorting using complete subintervals and the maximum number of runs in a randomly evolving sequence: Extended abstract.HAL CCSD2007sorting algorithmrunspriority queuessock-sortingevolution of random stringsBrownian motion[INFO.INFO-DS] Computer Science [cs]/Data Structures and Algorithms [cs.DS][INFO.INFO-DM] Computer Science [cs]/Discrete Mathematics [cs.DM][MATH.MATH-CO] Mathematics [math]/Combinatorics [math.CO][INFO.INFO-CG] Computer Science [cs]/Computational Geometry [cs.CG]Episciences Iam, CoordinationJacquet, Philippe2015-08-17 17:00:132017-05-11 01:02:522015-08-24 10:04:11enConference papershttps://hal.inria.fr/hal-01184796/document10.46298/dmtcs.3548application/pdf1We study the space requirements of a sorting algorithm where only items that at the end will be adjacent are kept together. This is equivalent to the following combinatorial problem: Consider a string of fixed length n that starts as a string of 0's, and then evolves by changing each 0 to 1, with the n changes done in random order. What is the maximal number of runs of 1's? We give asymptotic results for the distribution and mean. It turns out that, as in many problems involving a maximum, the maximum is asymptotically normal, with fluctuations of order \$n^{1/2}\$, and to the first order well approximated by the number of runs at the instance when the expectation is maximized, in this case when half the elements have changed to 1; there is also a second order term of order \$n^{1/3}\$. We also treat some variations, including priority queues and sock-sorting.