Sciweavers


Publication

Fun-Sort--or the chaos of unordered binary search

13 years 4 months ago
Fun-Sort--or the chaos of unordered binary search
Usually, binary search only makes sense in sorted arrays. We show that insertion sort based on repeated "binary searches" in an initially unsorted array also sorts n elements in time (n2 log n). If n is a power of two, then the expected termination point of a binary search in a random permutation of n elements is exactly the cell where the element should be if the array was sorted. We further show that we can sort in expected time (n2 log n) by always picking two random cells and swapping their contents if they are not ordered correctly. c 2004 Elsevier B.V. All rights reserved.
Added 17 Dec 2010
Updated 17 Dec 2010
Type Journal
Year 2004
Where DAM
Authors Therese C. Biedl, Timothy M. Chan, Erik D. Demaine, Rudolf Fleischer, Mordecai J. Golin, James A. King, J. Ian Munro
Comments (0)