Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/1953163.1953203acmconferencesArticle/Chapter ViewAbstractPublication PagessigcseConference Proceedingsconference-collections
research-article

Sorting algorithms as special cases of a priority queue sort

Published: 09 March 2011 Publication History

Abstract

This paper offers an exercise for revisiting the main sorting algorithms after they have been taught to students. This is done in a way that emphasizes the relationships between them, and shows how considering abstraction and extreme cases can lead to the generation of new algorithms. A number of authors (including textbook authors) have noted particular relationships between algorithms, such as an uneven split in merge sort being equivalent to insertion sort. In this paper we use a flexible priority queue, the d-heap, to derive three common sorting algorithms. We combine this with using a BST as a priority queue, plus prior observations in the literature, to show strong relationships between the main sorting algorithms that appear in textbooks. In the process students are able to revisit a number of algorithms and data structures and explore elegant relationships between them. This approach can also lead to exercises and exam questions that go beyond desk-checking to evaluate students' understanding of these algorithms.

References

[1]
Aho, A. V., Hopcroft J. E., and Ullman, J. D. 1983. Data Structures and Algorithms. Addison-Wesley, Reading, MA.
[2]
Astrachan, O. 2003. Bubble sort: an archaeological algorithmic analysis. SIGCSE Bull. 35, 1 (Jan. 2003), 1--5. DOI= http://doi.acm.org/10.1145/792548.611918.
[3]
Cormen, T. H., Leiserson, C. E., Rivest, R. L., and Stein, C. Introduction to Algorithms (3rd Ed.). The MIT Press, Cambridge, MA.
[4]
Douglas, A. S. 1959. Techniques for the recording of, and reference to data in a computer. The Computer Journal 2 (1959), 1--9
[5]
Dromey, R. G. 1987. Derivation of Sorting Algorithms from a Specification. The Computer Journal 30, 6 (1987), 512--518.
[6]
Floyd, R. W. 1964. Algorithm 245: Treesort. Commun. ACM 7, 12 (Dec. 1964), 701. DOI= http://doi.acm.org/10.1145/355588.365103
[7]
Johnson, D. B. 1975. Priority queues with update and finding minimum spanning trees. Information Processing Letters 4, 3 (Dec. 1975) 53--57. DOI= http://dx.doi.org/10.1016/0020-0190(75)90001-0.
[8]
Knuth, D. E. 1998. The Art of Computer Programming, Volume 3 (2nd Ed.) Sorting and Searching. Addison Wesley Longman Publishing Co., Inc., Reading, MA.
[9]
Manber, U. 1989. Introduction to algorithms: a creative approach. Addison-Wesley Publishing Co., Inc., Reading, MA.
[10]
Merritt, S. M. 1985. An inverted taxonomy of sorting algorithms. Commun. ACM 28, 1 (Jan. 1985), 96--99. DOI= http://doi.acm.org/10.1145/2465.214925.
[11]
Merrit S. M., and Lau, K.-K. 1997. A logical inverted taxonomy of sorting algorithms. In Proceedings of the Twelfth International Symposium on Computer and Information Sciences, S. Kuru, M. Caglayan, and H. Akin, Eds. (Bogazici University 1997) 576--583.
[12]
Sedgewick, R. 1983, 1988. Algorithms. Addison-Wesley Longman Publishing Co., Inc., Reading, MA.
[13]
Thorup, M. 2007. Equivalence between priority queues and sorting. J. ACM 54, 6 (Dec. 2007), 28. DOI= http://doi.acm.org/10.1145/1314690.1314692.
[14]
Weiss, M. A. 1995. Data Structures and Algorithm Analysis (2nd Ed.). Benjamin-Cummings Publishing Co., Inc., Readwood City, CA.
[15]
Williams, J. W. J. 1964. Algorithm 232: Heapsort. Commun. ACM 7 (1964), 347--348.
[16]
Wood, D. 1993. Data Structures, Algorithms, and Performance. Addison-Wesley Longman Publishing Co., Inc.

Cited By

View all
  • (2018)Graph traversals and spanning trees using metal highway data and visualizationsJournal of Computing Sciences in Colleges10.5555/3282588.328260334:2(102-109)Online publication date: 1-Dec-2018
  • (2018)Algorithm for Ethical Decision Making at Times of Accidents for Autonomous Vehicles2018 4th International Conference on Electrical Engineering and Information & Communication Technology (iCEEiCT)10.1109/CEEICT.2018.8628155(438-442)Online publication date: Sep-2018

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
SIGCSE '11: Proceedings of the 42nd ACM technical symposium on Computer science education
March 2011
754 pages
ISBN:9781450305006
DOI:10.1145/1953163
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 09 March 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. d-heap
  2. priority queue
  3. sorting algorithms

Qualifiers

  • Research-article

Conference

SIGCSE '11
Sponsor:

Acceptance Rates

SIGCSE '11 Paper Acceptance Rate 107 of 315 submissions, 34%;
Overall Acceptance Rate 1,595 of 4,542 submissions, 35%

Upcoming Conference

SIGCSE Virtual 2024
1st ACM Virtual Global Computing Education Conference
December 5 - 8, 2024
Virtual Event , NC , USA

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)15
  • Downloads (Last 6 weeks)0
Reflects downloads up to 21 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2018)Graph traversals and spanning trees using metal highway data and visualizationsJournal of Computing Sciences in Colleges10.5555/3282588.328260334:2(102-109)Online publication date: 1-Dec-2018
  • (2018)Algorithm for Ethical Decision Making at Times of Accidents for Autonomous Vehicles2018 4th International Conference on Electrical Engineering and Information & Communication Technology (iCEEiCT)10.1109/CEEICT.2018.8628155(438-442)Online publication date: Sep-2018

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media