{ "id": "0809.2957", "version": "v1", "published": "2008-09-17T16:29:38.000Z", "updated": "2008-09-17T16:29:38.000Z", "title": "Sorting by Placement and Shift", "authors": [ "Sergi Elizalde", "Peter Winkler" ], "comment": "13 pages, 4 figures, Proceedings of SODA 2009", "categories": [ "math.CO", "cs.DM", "cs.DS" ], "abstract": "In sorting situations where the final destination of each item is known, it is natural to repeatedly choose items and place them where they belong, allowing the intervening items to shift by one to make room. (In fact, a special case of this algorithm is commonly used to hand-sort files.) However, it is not obvious that this algorithm necessarily terminates. We show that in fact the algorithm terminates after at most $2^{n-1}-1$ steps in the worst case (confirming a conjecture of L. Larson), and that there are super-exponentially many permutations for which this exact bound can be achieved. The proof involves a curious symmetrical binary representation.", "revisions": [ { "version": "v1", "updated": "2008-09-17T16:29:38.000Z" } ], "analyses": { "subjects": [ "68W40", "68R05", "05A05" ], "keywords": [ "algorithm necessarily terminates", "special case", "repeatedly choose items", "final destination", "hand-sort files" ], "note": { "typesetting": "TeX", "pages": 13, "language": "en", "license": "arXiv", "status": "editable", "adsabs": "2008arXiv0809.2957E" } } }