skip to main content
article
Free Access

Algorithm 426: Merge sort algorithm [M1]

Published:01 May 1972Publication History
Skip Abstract Section

Abstract

Sorting by means of a two-way merge has a reputation of requiring a clerically complicated and cumbersome program. This ALGOL 60 procedure demonstrates that, using recursion, an elegant and efficient algorithm can be designed, the correctness of which is easily proved [2]. Sorting n objects gives rise to a maximum recursion depth of [log2(n - 1) + 2]. This procedure is particularly suitable for sorting when it is not desirable to move the n objects physically in store and the sorting criterion is not simple. In that case it is reasonable to take the number of compare operations as a measure for the speed of the algorithm. When n is an integral power of 2, this number will be comprised between (n × log2n)/2 when the objects are sorted to begin with and (n × log2n - n + 1) as an upper limit. When n is not an integral power of 2, the above formulas are approximate.

Skip Supplemental Material Section

Supplemental Material

References

  1. 1 Scowen, R.S. Quickersort, Comm. ACM8 (Oct. 1965), 669-670. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2 Bron, C., Proof of a merge sort algorithm, May 1971 (unpublished).Google ScholarGoogle Scholar

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in

Full Access

  • Published in

    cover image Communications of the ACM
    Communications of the ACM  Volume 15, Issue 5
    May 1972
    105 pages
    ISSN:0001-0782
    EISSN:1557-7317
    DOI:10.1145/355602
    Issue’s Table of Contents

    Copyright © 1972 ACM

    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 1 May 1972

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Author Tags

    Qualifiers

    • article

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader