{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,5,15]],"date-time":"2026-05-15T05:29:41Z","timestamp":1778822981026,"version":"3.51.4"},"reference-count":35,"publisher":"Association for Computing Machinery (ACM)","issue":"2","license":[{"start":{"date-parts":[[2018,4,16]],"date-time":"2018-04-16T00:00:00Z","timestamp":1523836800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/www.acm.org\/publications\/policies\/copyright_policy#Background"}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["ACM Trans. Algorithms"],"published-print":{"date-parts":[[2018,4,30]]},"abstract":"<jats:p>\n            We consider the classical selection and sorting problems in a model where the initial permutation of the input has to be\n            <jats:italic>restored<\/jats:italic>\n            after completing thecomputation. Such algorithms are useful for designing space-efficient algorithms, when one encounters subproblems that have to be solved by subroutines. It is important that these subroutines leave the array in its original state after they finish so that the computation can be properly resumed. Algorithms in this model can also be relevant for saving communication time, in case the data is distributed among several machines and would need to be copied to further machines for execution of the subroutine.\n          <\/jats:p>\n          <jats:p>\n            Although the requirement of the restoration is stringent compared to the classicalversions of the problems, this model is more relaxed than a read-only memory where the input elements are not allowed to be moved within the input array. We first show that for a sequence of\n            <jats:italic>n<\/jats:italic>\n            integers, selection (finding the median or more generally the\n            <jats:italic>k<\/jats:italic>\n            -th smallest element for a given\n            <jats:italic>k<\/jats:italic>\n            ) can be done in\n            <jats:italic>O<\/jats:italic>\n            (\n            <jats:italic>n<\/jats:italic>\n            ) time using\n            <jats:italic>O<\/jats:italic>\n            (lg\n            <jats:italic>n<\/jats:italic>\n            ) words\n            <jats:sup>1<\/jats:sup>\n            of extra space in this model. In contrast, no linear-time selection algorithm is known that uses polylogarithmic space in the read-only memory model.\n          <\/jats:p>\n          <jats:p>\n            For sorting\n            <jats:italic>n<\/jats:italic>\n            integers in this model, we first present an\n            <jats:italic>O<\/jats:italic>\n            (\n            <jats:italic>n<\/jats:italic>\n            lg\n            <jats:italic>n<\/jats:italic>\n            )-time algorithm using\n            <jats:italic>O<\/jats:italic>\n            (lg\n            <jats:italic>n<\/jats:italic>\n            ) words of extra space that outputs (in a write only tape) the given sequence in sorted order while restoring the order of the original input in the input tape. When the universe size\n            <jats:italic>U<\/jats:italic>\n            is polynomial in\n            <jats:italic>n<\/jats:italic>\n            , we give a faster\n            <jats:italic>O<\/jats:italic>\n            (\n            <jats:italic>n<\/jats:italic>\n            )-time algorithm (analogous to radix sort) that uses\n            <jats:italic>O<\/jats:italic>\n            (\n            <jats:italic>n<\/jats:italic>\n            <jats:sup>\u03b5<\/jats:sup>\n            ) words of extra space for an arbitrarily small constant \u03b5 &gt; 0. More generally, we show how to match the time bound of any word-RAM integer sorting algorithms using\n            <jats:italic>O<\/jats:italic>\n            (\n            <jats:italic>n<\/jats:italic>\n            <jats:sup>\u03b5<\/jats:sup>\n            ) words of extra space. In sharp contrast, there is an \u03a9 (\n            <jats:italic>n<\/jats:italic>\n            <jats:sup>2<\/jats:sup>\n            \/\n            <jats:italic>S<\/jats:italic>\n            )-time lower bound for integer sorting using\n            <jats:italic>O<\/jats:italic>\n            (\n            <jats:italic>S<\/jats:italic>\n            ) bits of space in the read-only memory model. Extension of our results to arbitrary input types beyond integers is not possible: for \u201cindivisible\u201d input elements, we can prove the same \u03a9 (\n            <jats:italic>n<\/jats:italic>\n            <jats:sup>2<\/jats:sup>\n            \/\n            <jats:italic>S<\/jats:italic>\n            ) lower bound for sorting in our model. We also describe space-efficient algorithms to count the number of inversions in a given sequence in this model.\n          <\/jats:p>\n          <jats:p>En route, we develop linear-time in-place algorithms to extract leading bits of the input array and to compress and decompress strings with low entropy; these techniques may be of independent interest.<\/jats:p>","DOI":"10.1145\/3168005","type":"journal-article","created":{"date-parts":[[2018,4,18]],"date-time":"2018-04-18T17:21:50Z","timestamp":1524072110000},"page":"1-18","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":6,"title":["Selection and Sorting in the \u201cRestore\u201d Model"],"prefix":"10.1145","volume":"14","author":[{"given":"Timothy M.","family":"Chan","sequence":"first","affiliation":[{"name":"University of Illinois at Urbana\u2013Champaign, Urbana, IL"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"J. Ian","family":"Munro","sequence":"additional","affiliation":[{"name":"University of Waterloo, Waterloo, Ontario, Canada"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Venkatesh","family":"Raman","sequence":"additional","affiliation":[{"name":"Institute of Mathematical Sciences, HBNI, Chennai"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2018,4,16]]},"reference":[{"key":"e_1_2_1_1_1","doi-asserted-by":"publisher","DOI":"10.1006\/jcss.2002.1821"},{"key":"e_1_2_1_2_1","doi-asserted-by":"publisher","DOI":"10.1006\/jcss.1998.1580"},{"key":"e_1_2_1_3_1","volume-title":"Proceedings of the 10th International Conference on Theory and Applications of Models of Computation (TAMC\u201913)","author":"Asano T.","unstructured":"T. Asano , A. Elmasry , and J. Katajainen . 2013. Priority queues and sorting for read-only data . In Proceedings of the 10th International Conference on Theory and Applications of Models of Computation (TAMC\u201913) . 32--41. T. Asano, A. Elmasry, and J. Katajainen. 2013. Priority queues and sorting for read-only data. In Proceedings of the 10th International Conference on Theory and Applications of Models of Computation (TAMC\u201913). 32--41."},{"key":"e_1_2_1_4_1","first-page":"46","article-title":"Constant-work-space algorithms for geometric problems","volume":"2","author":"Asano T.","year":"2011","unstructured":"T. Asano , W. Mulzer , G. Rote , and Y. Wang . 2011 . Constant-work-space algorithms for geometric problems . Journal of Computational Geometry 2 , 1, 46 -- 68 . T. Asano, W. Mulzer, G. Rote, and Y. Wang. 2011. Constant-work-space algorithms for geometric problems. Journal of Computational Geometry 2, 1, 46--68.","journal-title":"Journal of Computational Geometry"},{"key":"e_1_2_1_5_1","doi-asserted-by":"publisher","DOI":"10.1137\/0220017"},{"key":"e_1_2_1_6_1","volume-title":"Lecture Notes in Computer Science","volume":"9134","author":"Beame P.","unstructured":"P. Beame , V. Liew , and M. P\u01cetra\u015fcu . 2015. Finding the median (obliviously) with bounded space. In Automata, Languages, and Programming . Lecture Notes in Computer Science , Vol. 9134 . Springer, 103--115. P. Beame, V. Liew, and M. P\u01cetra\u015fcu. 2015. Finding the median (obliviously) with bounded space. In Automata, Languages, and Programming. Lecture Notes in Computer Science, Vol. 9134. Springer, 103--115."},{"key":"e_1_2_1_7_1","doi-asserted-by":"publisher","DOI":"10.1137\/0211022"},{"key":"e_1_2_1_8_1","doi-asserted-by":"publisher","DOI":"10.1016\/0022-0000(81)90037-4"},{"key":"e_1_2_1_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/997817.997854"},{"key":"e_1_2_1_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/1721837.1721842"},{"key":"e_1_2_1_11_1","doi-asserted-by":"publisher","DOI":"10.1007\/s00454-006-1275-6"},{"key":"e_1_2_1_12_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.comgeo.2010.04.005"},{"key":"e_1_2_1_13_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.tcs.2015.03.042"},{"key":"e_1_2_1_14_1","volume-title":"Proceedings of the 21st ACM-SIAM Symposium on Discrete Algorithms (SODA\u201910)","author":"Chan T. M.","unstructured":"T. M. Chan and M. P\u01cetra\u015fcu . 2010. Counting inversions, offline orthogonal range counting, and related problems . In Proceedings of the 21st ACM-SIAM Symposium on Discrete Algorithms (SODA\u201910) . 161--173. T. M. Chan and M. P\u01cetra\u015fcu. 2010. Counting inversions, offline orthogonal range counting, and related problems. In Proceedings of the 21st ACM-SIAM Symposium on Discrete Algorithms (SODA\u201910). 161--173."},{"key":"e_1_2_1_15_1","unstructured":"T. H. Cormen C. E. Leiserson R. L. Rivest and C. Stein. 2009. Introduction to Algorithms (3rd. ed.). MIT Press Cambridge MA.   T. H. Cormen C. E. Leiserson R. L. Rivest and C. Stein. 2009. Introduction to Algorithms (3rd. ed.). MIT Press Cambridge MA."},{"key":"e_1_2_1_16_1","volume-title":"Proceedings of the 18th International Symposium on String Processing and Information Retrieval (SPIRE\u201911)","author":"Claude F.","unstructured":"F. Claude , P. K. Nicholson , and D. Seco . 2011. Space efficient wavelet tree construction . In Proceedings of the 18th International Symposium on String Processing and Information Retrieval (SPIRE\u201911) . 185--196. F. Claude, P. K. Nicholson, and D. Seco. 2011. Space efficient wavelet tree construction. In Proceedings of the 18th International Symposium on String Processing and Information Retrieval (SPIRE\u201911). 185--196."},{"key":"e_1_2_1_17_1","volume-title":"Proceedings of the 24th Symposium on Combinatorial Pattern Matching (CPM\u201913)","author":"Crochemore M.","unstructured":"M. Crochemore , R. Grossi , J. K\u00e4rkk\u00e4inen , and G. M. Landau . 2013. A constant-space comparison-based algorithm for computing the Burrows-Wheeler transform . In Proceedings of the 24th Symposium on Combinatorial Pattern Matching (CPM\u201913) . 74--82. M. Crochemore, R. Grossi, J. K\u00e4rkk\u00e4inen, and G. M. Landau. 2013. A constant-space comparison-based algorithm for computing the Burrows-Wheeler transform. In Proceedings of the 24th Symposium on Combinatorial Pattern Matching (CPM\u201913). 74--82."},{"key":"e_1_2_1_18_1","volume-title":"Proceedings of the 17th International Conference on Computing and Combinatorics (COCOON\u201913)","author":"Elmasry A.","unstructured":"A. Elmasry , D. D. Juhl , J. Katajainen , and S. Rao Satti . 2013. Selection from read-only memory with limited work space . In Proceedings of the 17th International Conference on Computing and Combinatorics (COCOON\u201913) . 147--157. A. Elmasry, D. D. Juhl, J. Katajainen, and S. Rao Satti. 2013. Selection from read-only memory with limited work space. In Proceedings of the 17th International Conference on Computing and Combinatorics (COCOON\u201913). 147--157."},{"key":"e_1_2_1_19_1","doi-asserted-by":"publisher","DOI":"10.1137\/S0097539792238649"},{"key":"e_1_2_1_20_1","volume-title":"Proceedings of the 34th International Colloquium on Automata, Languages, and Programming (ICALP\u201907)","author":"Franceschini G.","unstructured":"G. Franceschini and S. Muthukrishnan . 2007. In-place suffix sorting . In Proceedings of the 34th International Colloquium on Automata, Languages, and Programming (ICALP\u201907) . 533--545. G. Franceschini and S. Muthukrishnan. 2007. In-place suffix sorting. In Proceedings of the 34th International Colloquium on Automata, Languages, and Programming (ICALP\u201907). 533--545."},{"key":"e_1_2_1_21_1","volume-title":"Proceedings of the 15th European Symposium on Algorithms (ESA\u201907)","author":"Franceschini G.","unstructured":"G. Franceschini , S. Muthukrishnan , and M. P\u01cetra\u015fcu . 2007. Radix sorting with no extra space . In Proceedings of the 15th European Symposium on Algorithms (ESA\u201907) . 194--205. G. Franceschini, S. Muthukrishnan, and M. P\u01cetra\u015fcu. 2007. Radix sorting with no extra space. In Proceedings of the 15th European Symposium on Algorithms (ESA\u201907). 194--205."},{"key":"e_1_2_1_22_1","doi-asserted-by":"publisher","DOI":"10.1016\/0022-0000(87)90002-X"},{"key":"e_1_2_1_23_1","unstructured":"R. Grossi. 2011. Private communication. https:\/\/www.imsc.res.in\/dsmeet\/grossi_dsmeet2011_1.pdf.  R. Grossi. 2011. Private communication. https:\/\/www.imsc.res.in\/dsmeet\/grossi_dsmeet2011_1.pdf."},{"key":"e_1_2_1_24_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.jalgor.2003.09.001"},{"key":"e_1_2_1_25_1","volume-title":"Proceedings of the 43rd IEEE Symposium on Foundations of Computer Science (FOCS\u201902)","author":"Han Y.","unstructured":"Y. Han and M. Thorup . 2002. Integer sorting in O(n&Sqrt;lg lg n) expected time and linear space . In Proceedings of the 43rd IEEE Symposium on Foundations of Computer Science (FOCS\u201902) . 135--144. Y. Han and M. Thorup. 2002. Integer sorting in O(n&Sqrt;lg lg n) expected time and linear space. In Proceedings of the 43rd IEEE Symposium on Foundations of Computer Science (FOCS\u201902). 135--144."},{"key":"e_1_2_1_26_1","doi-asserted-by":"publisher","DOI":"10.1007\/BF01994842"},{"key":"e_1_2_1_27_1","doi-asserted-by":"publisher","DOI":"10.1007\/BF01178508"},{"key":"e_1_2_1_28_1","volume-title":"Proceedings of the 1st Scandinavian Workshop on Algorithm Theory (SWAT\u201988)","author":"Lai T. W.","unstructured":"T. W. Lai and D. Wood . 1988. Implicit selection . In Proceedings of the 1st Scandinavian Workshop on Algorithm Theory (SWAT\u201988) . 14--23. T. W. Lai and D. Wood. 1988. Implicit selection. In Proceedings of the 1st Scandinavian Workshop on Algorithm Theory (SWAT\u201988). 14--23."},{"key":"e_1_2_1_29_1","doi-asserted-by":"publisher","DOI":"10.1016\/0304-3975(80)90061-4"},{"key":"e_1_2_1_30_1","doi-asserted-by":"publisher","DOI":"10.1016\/0304-3975(95)00225-1"},{"key":"e_1_2_1_31_1","doi-asserted-by":"publisher","DOI":"10.1007\/BF02017344"},{"key":"e_1_2_1_32_1","volume-title":"Proceedings of the 13th ACM--SIAM Symposium on Discrete Algorithms (SODA\u201902)","author":"Pagh R.","unstructured":"R. Pagh and J. Pagter . 2002. Optimal time-space trade-offs for non-comparison-based sorting . In Proceedings of the 13th ACM--SIAM Symposium on Discrete Algorithms (SODA\u201902) . 9--18. R. Pagh and J. Pagter. 2002. Optimal time-space trade-offs for non-comparison-based sorting. In Proceedings of the 13th ACM--SIAM Symposium on Discrete Algorithms (SODA\u201902). 9--18."},{"key":"e_1_2_1_33_1","volume-title":"Proceedings of the 39th IEEE Symposium on Foundations of Computer Science (FOCS\u201998)","author":"Pagter J.","unstructured":"J. Pagter and T. Rauhe . 1998. Optimal time-space tradeoffs for sorting . In Proceedings of the 39th IEEE Symposium on Foundations of Computer Science (FOCS\u201998) . 264--268. J. Pagter and T. Rauhe. 1998. Optimal time-space tradeoffs for sorting. In Proceedings of the 39th IEEE Symposium on Foundations of Computer Science (FOCS\u201998). 264--268."},{"key":"e_1_2_1_34_1","doi-asserted-by":"publisher","DOI":"10.5555\/762350.762354"},{"key":"e_1_2_1_35_1","doi-asserted-by":"publisher","DOI":"10.5555\/2018243.2018264"}],"container-title":["ACM Transactions on Algorithms"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3168005","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3168005","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,18]],"date-time":"2025-06-18T02:26:07Z","timestamp":1750213567000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3168005"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2018,4,16]]},"references-count":35,"journal-issue":{"issue":"2","published-print":{"date-parts":[[2018,4,30]]}},"alternative-id":["10.1145\/3168005"],"URL":"https:\/\/doi.org\/10.1145\/3168005","relation":{},"ISSN":["1549-6325","1549-6333"],"issn-type":[{"value":"1549-6325","type":"print"},{"value":"1549-6333","type":"electronic"}],"subject":[],"published":{"date-parts":[[2018,4,16]]},"assertion":[{"value":"2016-12-01","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2017-11-01","order":1,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2018-04-16","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}