Abstract
A sorting algorithm, in software, is usually described as re-arranging an array of N keys. Each comparator in the sorting network hardware can be implemented in software as a call, C(Lo, Hi), to a subroutine that compares K[Lo] with K[Hi] and swaps them if K[Lo] > K[Hi]—K is a global array of keys and index Lo is less than index Hi in each call. Software representations of sorting networks are shown with diagrams that we call Knuth diagrams . Each key-index in the array being sorted is represented by a horizontal line in the Knuth diagram and each subroutine call, C(Lo, Hi), is represented by a vertical line between the horizontal lines of the Lo and Hi indices. Permuting the locations of the keys generates a re-labeled software program or Knuth diagram for a given sorting network. Though it looks different, the re-labeled version of the network is equivalent to the original version. However, since it looks different, the re-labeled network can help us better understand the behavior of the sorting network and this can help us discover even better networks.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Akl SG (1997) Parallel computation: models and methods. Prentice-Hall, NJ
Knuth D (1998) The art of computer programming: volume 3 sorting and searching, 2nd edn. Addison-Wesley Longman, USA, pp 225–228
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2011 Springer Science+Business Media, LLC
About this chapter
Cite this chapter
Al-Haj Baddar, S.W., Batcher, K.E. (2011). Software Implementations. In: Designing Sorting Networks. Springer, New York, NY. https://doi.org/10.1007/978-1-4614-1851-1_2
Download citation
DOI: https://doi.org/10.1007/978-1-4614-1851-1_2
Published:
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4614-1850-4
Online ISBN: 978-1-4614-1851-1
eBook Packages: Computer ScienceComputer Science (R0)