Skip to main content
Log in

Two Skew-Binary Numeral Systems and One Application

  • Published:
Theory of Computing Systems Aims and scope Submit manuscript

Abstract

We introduce two numeral systems, the magical skew system and the regular skew system, and contribute to their theory development. For both systems, increments and decrements are supported using a constant number of digit changes per operation. Moreover, for the regular skew system, the operation of adding two numbers is supported efficiently. Our basic message is that some data-structural problems are better formulated at the level of a numeral system. The relationship between number representations and data representations, as well as operations on them, can be utilized for an elegant description and a clean analysis of algorithms. In many cases, a pure mathematical treatment may also be interesting in its own right. As an application of numeral systems to data structures, we consider how to implement a priority queue as a forest of pointer-based binary heaps. Some of the number-representation features that influence the efficiency of the priority-queue operations include weighting of digits, carry-propagation and borrowing mechanisms.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Elmasry, A., Jensen, C., Katajainen, J.: The magic of a number system. In: Proceedings of the 5th International Conference on Fun with Algorithms. Lecture Notes in Computer Science, vol. 6099, pp. 156–165. Springer, Berlin (2010)

    Chapter  Google Scholar 

  2. Vuillemin, J.: A data structure for manipulating priority queues. Commun. ACM 21(4), 309–315 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  3. Clancy, M., Knuth, D.: A programming and problem-solving seminar. Technical report STAN-CS-77-606, Department of Computer Science, Stanford University (1977)

  4. Myers, E.W.: An applicative random-access stack. Inf. Process. Lett. 17(5), 241–248 (1983)

    Article  MATH  Google Scholar 

  5. Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1998)

    Book  Google Scholar 

  6. Williams, J.W.J.: Algorithm 232: Heapsort. Commun. ACM 7(6), 347–348 (1964)

    Google Scholar 

  7. Gonnet, G.H., Munro, J.I.: Heaps on heaps. SIAM J. Comput. 15(4), 964–971 (1986)

    Article  MathSciNet  MATH  Google Scholar 

  8. Carlsson, S., Munro, J.I., Poblete, P.V.: An implicit binomial queue with constant insertion time. In: Proceedings of the 1st Scandinavian Workshop on Algorithm Theory. Lecture Notes in Computer Science, vol. 318, pp. 1–13. Springer, Berlin (1988)

    Google Scholar 

  9. Brodal, G.S., Okasaki, C.: Optimal purely functional priority queues. J. Funct. Program. 6(6), 839–857 (1996)

    Article  MATH  Google Scholar 

  10. Sack, J.R., Strothotte, T.: A characterization of heaps and its applications. Inf. Comput. 86(1), 69–86 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  11. Bansal, S., Sreekanth, S., Gupta, P.: M-heap: A modified heap data structure. Int. J. Found. Comput. Sci. 14(3), 491–502 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  12. Harvey, N.J.A., Zatloukal, K.: The post-order heap. In: Proceedings of the 3rd International Conference on Fun with Algorithms (2004)

    Google Scholar 

  13. Elmasry, A., Jensen, C., Katajainen, J.: Multipartite priority queues. ACM Trans. Algorithms 5(1), 14:1–14:19 (2008)

    Article  MathSciNet  Google Scholar 

  14. Elmasry, A., Jensen, C., Katajainen, J.: Two-tier relaxed heaps. Acta Inform. 45(3), 193–210 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  15. Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press, Cambridge (2009)

    MATH  Google Scholar 

  16. Brown, M.R.: Implementation and analysis of binomial queue algorithms. SIAM J. Comput. 7(3), 298–319 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  17. Fredman, M.L., Tarjan, R.E.: Fibonacci heaps and their uses in improved network optimization algorithms. J. ACM 34(3), 596–615 (1987)

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jyrki Katajainen.

Additional information

A preliminary version of this paper entitled “The magic of a number system” [1] was presented at the 5th International Conference on Fun with Algorithms held on Ischia Island in June 2010.

A. Elmasry was supported by the Alexander von Humboldt Foundation and the VELUX Foundation.

J. Katajainen was partially supported by the Danish Natural Science Research Council under contract 09-060411 (project “Generic programming—algorithms and tools”).

Rights and permissions

Reprints and permissions

About this article

Cite this article

Elmasry, A., Jensen, C. & Katajainen, J. Two Skew-Binary Numeral Systems and One Application. Theory Comput Syst 50, 185–211 (2012). https://doi.org/10.1007/s00224-011-9357-0

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00224-011-9357-0

Keywords

Navigation