Skip to main content

Sorting and Searching by Distribution: From Generic Discrimination to Generic Tries

  • Conference paper
Programming Languages and Systems (APLAS 2013)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 8301))

Included in the following conference series:

Abstract

A discriminator partitions values associated with keys into groups listed in ascending order. Discriminators can be defined generically by structural recursion on representations of ordering relations. Employing type-indexed families we demonstrate how tries with an optimal-time lookup function can be constructed generically in worst-case linear time. We provide generic implementations of comparison, sorting, discrimination and trie building functions and give equational proofs of correctness that highlight core relations between these algorithms.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Strachey, C.: Fundamental concepts in programming languages. Higher-order and Symbolic Computation 13(1), 11–49 (2000)

    Article  MATH  Google Scholar 

  2. Henglein, F.: Generic discrimination: Sorting and partitioning unshared data in linear time. In: Hook, J., Thiemann, P. (eds.) Proc. 13th ACM SIGPLAN Int’l Conf. on Functional Programming (ICFP), pp. 91–102. ACM (September 2008)

    Google Scholar 

  3. Henglein, F.: Generic top-down discrimination for sorting and partitioning in linear time. Journal of Functional Programming (JFP) 22(3), 300–374 (2012)

    Article  MathSciNet  Google Scholar 

  4. Bentley, J.L., Sedgewick, R.: Fast algorithms for sorting and searching strings. In: SODA 1997: Proceedings of the Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 360–369. Society for Industrial and Applied Mathematics, Philadelphia (1997)

    Google Scholar 

  5. Hinze, R.: Generalizing generalized tries. Journal of Functional Programming 10(4), 327–351 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  6. Hoare, C.A.: Quicksort. The Computer Journal 5(1), 10–16 (1962)

    Article  MathSciNet  MATH  Google Scholar 

  7. Bayer, R.: Symmetric binary B-trees: Data structure and maintenance algorithms. Acta Informatica 1(4), 290–306 (1972)

    Article  MathSciNet  MATH  Google Scholar 

  8. Guibas, L.J., Sedgewick, R.: A dichromatic framework for balanced trees. In: Proc. 19th Annual Symposium on Foundations of Computer Science (FOCS), pp. 8–21. IEEE (1978)

    Google Scholar 

  9. Cai, J., Paige, R.: Using multiset discrimination to solve language processing problems without hashing. Theoretical Computer Science (TCS) 145(1-2), 189–228 (1995)

    Article  MathSciNet  MATH  Google Scholar 

  10. Connelly, R.H., Morris, F.L.: A generalization of the trie data structure. Mathematical Structures in Computer Science 5(3), 381–418 (1995)

    Article  MathSciNet  MATH  Google Scholar 

  11. Wadler, P.: Theorems for free! In: Proc. Functional Programming Languages and Computer Architecture (FPCA), pp. 347–359. ACM Press, London (1989)

    Google Scholar 

  12. Day, N.A., Launchbury, J., Lewis, J.: Logical abstractions in Haskell. In: Proc. Haskell Workshop. Number UU-CS-1999-28 in Technical Report, Utrecht, The Netherlands, Utrecht University (1999)

    Google Scholar 

  13. Knuth, D.: The Art of Computer Programming: Sorting and Searching, 2nd edn., vol. 3. Addison Wesley (1998)

    Google Scholar 

  14. Henglein, F.: What is a sorting function? J. Logic and Algebraic Programming (JLAP) 78(5), 381–401 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  15. Gibbons, J.: A pointless derivation of radix sort. Journal of Functional Programming 9(3), 339–346 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  16. Paige, R., Tarjan, R.E.: Three partition refinement algorithms. SIAM Journal of Computing 16(6), 973–989 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  17. Sinha, R., Zobel, J.: Efficient trie-based sorting of large sets of strings. In: Proc. 26th Australasian Computer Science Conference (ACSC), pp. 11–18 (2003)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer International Publishing Switzerland

About this paper

Cite this paper

Henglein, F., Hinze, R. (2013). Sorting and Searching by Distribution: From Generic Discrimination to Generic Tries. In: Shan, Cc. (eds) Programming Languages and Systems. APLAS 2013. Lecture Notes in Computer Science, vol 8301. Springer, Cham. https://doi.org/10.1007/978-3-319-03542-0_23

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-03542-0_23

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-03541-3

  • Online ISBN: 978-3-319-03542-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics