{"title":"A Novel In-Place Sorting Algorithm with O(n log z) Comparisons and O(n log z) Moves","authors":"Hanan Ahmed-Hosni Mahmoud, Nadia Al-Ghreimil","volume":22,"journal":"International Journal of Computer and Information Engineering","pagesStart":3484,"pagesEnd":3490,"ISSN":"1307-6892","URL":"https:\/\/publications.waset.org\/pdf\/10106","abstract":"<p>In-place sorting algorithms play an important role in many fields such as very large database systems, data warehouses, data mining, etc. Such algorithms maximize the size of data that can be processed in main memory without input\/output operations. In this paper, a novel in-place sorting algorithm is presented. The algorithm comprises two phases; rearranging the input unsorted array in place, resulting segments that are ordered relative to each other but whose elements are yet to be sorted. The first phase requires linear time, while, in the second phase, elements of each segment are sorted inplace in the order of z log (z), where z is the size of the segment, and O(1) auxiliary storage. The algorithm performs, in the worst case, for an array of size n, an O(n log z) element comparisons and O(n log z) element moves. Further, no auxiliary arithmetic operations with indices are required. Besides these theoretical achievements of this algorithm, it is of practical interest, because of its simplicity. Experimental results also show that it outperforms other in-place sorting algorithms. Finally, the analysis of time and space complexity, and required number of moves are presented, along with the auxiliary storage requirements of the proposed algorithm.<\/p>\r\n","references":"[1] A. LaMarca and R. E. Ladner, \"The influence of caches on the\r\nperformance of heaps,\" Journal of Experimental Algorithmics, vol. 1,\r\nArticle 4, 1996.\r\n[2] D. Knuth, The Art of Computer Programming: Volume 3 \/ Sorting and\r\nSearching, Addison-Wesley Publishing Company, 1973.\r\n[3] Y. Azar, A. Broder, A. Karlin, and E. Upfal, \"Balanced allocations,\" in\r\nProceedings of 26th ACM Symposium on the Theory of Computing,\r\n1994, pp.593-602.\r\n[4] Andrei Broder and Michael Mitzenmacher.\"Using multiple hash\r\nfunctions to improve IP lookups,\" in Proceedings of IEEE INFOCOM,\r\n2001.\r\n[5] Jan Van Lunteren, \"Searching very large routing tables in wide\r\nembedded memory,\" in Proceedings of IEEE Globecom, November\r\n2001.\r\n[6] Ramesh C. Agarwal, \"A super scalar sort algorithm for RISC\r\nprocessors,\" SIGMOD Record (ACM Special Interest Group on\r\nManagement of Data), 25(2):240-246, June 1996.\r\n[7] R. Anantha Krishna, A. Das, J. Gehrke, F. Korn, S. Muthukrishnan, and\r\nD. Shrivastava, \"Efficient approximation of correlated sums on data\r\nstreams,\" TKDE, 2003.\r\n[8] A. Arasu and G. S. Manku, \"Approximate counts and quantiles over\r\nsliding windows,\" PODS, 2004.\r\n[9] N. Bandi, C. Sun, D. Agrawal, and A. El Abbadi, \"Hardware\r\nacceleration in commercial databases: A case study of spatial\r\noperations,\" VLDB, 2004.\r\n[10] Peter A. Boncz, Stefan Manegold, and Martin L. Kersten, \"Database\r\narchitecture optimized for the new bottleneck: Memory access,\" in\r\nProceedings of the Twenty-fifth International Conference on Very Large\r\nDatabases, 1999, pp. 54-65.\r\n[11] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein, Introduction\r\nto Algorithms. MIT Press, Cambridge, MA, 2nd edition, 2001.\r\n[12] Abhinandan Das, Johannes Gehrke, and Mirek Riedewald,\r\n\"Approximate join processing over data streams,\" in Proceedings of the\r\n2003 ACM SIGMOD international conference on Management of data,\r\nACM Press, 2003, pp.40-51.\r\n[13] A. LaMarca and R. Ladner, \"The influence of caches on the performance\r\nof sorting,\" in Proc. of the ACM\/SIAM SODA, 1997, pp. 370-379.\r\n[14] Stefan Manegold, Peter A. Boncz, and Martin L. Kersten, \"What\r\nhappens during a join? Dissecting CPU and memory optimization\r\neffects,\" in Proceedings of 26th International Conference on Very Large\r\nData Bases, 2000, pp. 339-350.\r\n[15] A. Andersson, T. Hagerup, J. H\u252c\u2591astad, and O. Petersson, \"Tight bounds\r\nfor searching a sorted array of strings,\" SIAM Journal on Computing,\r\n30(5):1552-1578, 2001.\r\n[16] L. Arge, P. Ferragina, R. Grossi, and J.S. Vitter, \"On sorting strings in\r\nexternal memory,\" ACM STOC -97, 1997, pp.540-548.\r\n[17] M.A. Bender, E.D. Demaine, andM. Farach-Colton, \"Cache-oblivious Btrees,\"\r\nIEEE FOCS -00, 2000, pp.399-409.\r\n[18] J.L. Bentley and R. Sedgewick, \"Fast algorithms for sorting and\r\nsearching strings,\" ACM-SIAM SODA -97, 1997, pp.360-369.\r\n[19] G. Franceschini, \"Proximity mergesort: Optimal in-place sorting in the\r\ncacheoblivious model,\" ACM-SIAM SODA -04, 2004, pp.284-292.\r\n[20] G. Franceschini. \"Sorting stably, in-place, with O(n log n) comparisons\r\nand O(n) moves,\" STACS -05, 2005.\r\n[21] G. Franceschini and V. Geffert. \"An In-Place Sorting with O(n log n)\r\nComparisons and O(n) Moves,\" IEEE FOCS -03, 2003, pp. 242-250.","publisher":"World Academy of Science, Engineering and Technology","index":"Open Science Index 22, 2008"}