Skip to main content
Log in

Regular numeral systems for data structures

  • Original Article
  • Published:
Acta Informatica Aims and scope Submit manuscript

Abstract

We formalize several regular numeral systems, state their properties and supported operations, clarify the correctness, and tabulate the proofs. Our goal is to use as few symbols in the presentation of digits and make as few digit changes as possible in every operation. Most importantly, we introduce two new systems: (1) the buffered regular system is simple and allows the increment and decrement of the least-significant digit in constant time, and (2) the strictly regular system allows the increment and decrement of a digit at arbitrary position with a constant number of digit changes while using three symbols only (instead of four symbols required by the extended regular system). To demonstrate the usefulness of the regular systems, we survey how they have been used in the design of data structures.

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.

Fig. 1
Fig. 2
Fig. 3
Fig. 4

Similar content being viewed by others

References

  1. Aho, A.V., Lam, M.S., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, & Tools, 2nd edn. Pearson Education Inc, London (2007)

    MATH  Google Scholar 

  2. Avizienis, A.: Signed-digit numbe[r] representations for fast parallel arithmetic. IRE Trans. Electron. Comput EC–10(3), 389–400 (1961)

  3. Bitner, J.R., Ehrlich, G., Reingold, E.M.: Efficient generation of the binary reflected Gray code and its applications. Commun. ACM 19(9), 517–521 (1976)

    Article  MathSciNet  Google Scholar 

  4. Boothroyd, J.: Algorithm 246: Graycode. Commun. ACM 7(12), 701 (1964)

    Article  Google Scholar 

  5. Bose, P., Carmi, P., Jansens, D., Maheshwari, A., Morin, P,, Smid, M.: Improved methods for generating quasi-Gray codes. In: 12th Scandinavian Symposium and Workshops on Algorithm Theory, Volume 6139 of Lecture Notes in Computer Science, pp. 224–235. Springer (2010)

  6. Brodal, G.: Fast meldable priority queues. In: 4th International Workshop on Algorithms and Data Structures, volume 955 of Lecture Notes in Computer Science, pp. 282–290. Springer (1995)

  7. Brodal, G.: Worst-case efficient priority queues. In: 7th Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 52–58. SIAM (1996)

  8. Brodal, G., Greve, M., Pandey, V., Rao, S.S.: Integer representations towards efficient counting in the bit probe model. In: 8th Annual Conference on Theory and Applications of Models of Computation, Volume 6648 of Lecture Notes in Computer Science, pp. 206–217. Springer (2011)

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

    Article  MathSciNet  Google Scholar 

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

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

  12. Collignon, E.: Note sur l’arithmétique binaire. Journal de Mathématiques Élémentaires, 21, 101–106, 126–131, 148–151, 171–174 (1897)

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

    MATH  Google Scholar 

  14. Driscoll, J.R., Gabow, H.N., Shrairman, R., Tarjan, R.E.: Relaxed heaps: an alternative to Fibonacci heaps with applications to parallel computation. Commun. ACM 31(11), 1343–1354 (1988)

    Article  MathSciNet  Google Scholar 

  15. Ronald, D.: Dutton. Weak-heap sort. BIT 33(3), 372–381 (1993)

    Article  MathSciNet  Google Scholar 

  16. Edelkamp, S., Elmasry, A., Katajainen, J.: The weak-heap data structure: variants and applications. J. Discrete Algorithms 16, 187–205 (2012)

    Article  MathSciNet  Google Scholar 

  17. Edelkamp, S., Elmasry, A., Katajainen, J.: The weak-heap family of priority queues in theory and praxis. In: 18th Computing: The Australasian Theory Symposium, Volume 128 of Conferences in Research and Practice in Information Technology, pp. 103–112. Australian Computer Society, Inc. (2012)

  18. Elmasry, A.: A priority queue with the working-set property. Int. J. Found. Comput. Sci. 17(6), 1455–1465 (2006)

    Article  MathSciNet  Google Scholar 

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

  20. Elmasry, A., Jensen, C., Katajainen, J.: Two new methods for constructing double-ended priority queues from priority queues. Computing 83(4), 193–204 (2008)

    Article  MathSciNet  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

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

  23. Elmasry, A., Jensen, C., Katajainen, J.: Strictly-regular number system and data structures. In: 12th Scandinavian Symposium and Workshops on Algorithm Theory, Volume 6139 of Lecture Notes in Computer Science, pp. 26–37. Springer (2010)

  24. Elmasry, A., Jensen, C., Katajainen, J.: Two skew-binary numeral systems and one application. Theory Comput. Syst. 50(1), 185–211 (2012)

    Article  MathSciNet  Google Scholar 

  25. Elmasry, A., Jensen, C., Katajainen, J.: Bipartite binomial heaps. RAIRO Theor. Inform. Appl. 51(3), 121–133 (2017)

    Article  MathSciNet  Google Scholar 

  26. Elmasry, A., Kahla, M., Ahdy, F., Hashem, M.: Red-black trees with constant update time. Acta Inform. 56(5), 391–404 (2019)

    Article  MathSciNet  Google Scholar 

  27. Elmasry, A., Katajainen, J.: Worst-case optimal priority queues via extended regular counters. In: 7th International Computer Science Symposium in Russia, Volume 7353 of Lecture Notes in Computer Science, pp. 130–142. Springer (2012)

  28. Elmasry, A., Katajainen, J.: Fat heaps without regular counters. Discrete Math. Algorithms Appl., 5(2) (2013)

  29. Elmasry, A., Katajainen, J.: In-place binary counters. In: 38th International Symposium on Mathematical Foundations of Computer Science, Volume 8087 of Lecture Notes in Computer Science, pp. 349–360. Springer (2013)

  30. Glaser, A.: History of Binary and Other Nondecimal Numeration. Tomash Publishers, revised edition (1981)

  31. Gray, F.: Pulse code communications. U.S. Patent 2632058 (1953)

  32. Guibas, L.J., McCreight, E.M., Plass, M.F., Roberts, J.R.: A new representation for linear lists. In: 9th Annual ACM Symposium on Theory of Computing, pp. 49–60. ACM (1977)

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

  34. Hagerup, T.: Sorting and searching on the word RAM. In: 15th Annual Symposium on Theoretical Aspects of Computer Science, Volume 1373 of Lecture Notes in Computer Science, pp. 366–398. Springer (1998)

  35. Hood, R., Melville, R.: Real-time queue operations in Pure LISP. Inf. Process. Lett. 13(2), 50–54 (1981)

    Article  Google Scholar 

  36. Kaplan, H., Shafrir, N., Tarjan, R.E.: Meldable heaps and Boolean union-find. In: 34th Annual ACM Symposium on Theory of Computing, pp. 573–582. ACM (2002)

  37. Kaplan, H., Tarjan, R.E.: Purely functional representations of catenable sorted lists. In:28th Annual ACM Symposium on Theory of Computing, pp. 202–211. ACM (1996)

  38. Kaplan, H., Tarjan, R.E.: New heap data structures. Technical Report TR-597-99, Department of Computer Science, Princeton University (1999)

  39. Kaplan, H., Tarjan, R.E.: Purely functional, real-time deques with catenation. J. ACM 46(5), 577–603 (1999)

    Article  MathSciNet  Google Scholar 

  40. Katajainen, J.: Worst-case-efficient dynamic arrays in practice. In: 15th International Symposium on Experimental Algorithms, Volume 9685 of Lecture Notes in Computer Science, pp. 167–183. Springer (2016)

  41. Katajainen, J.M., Bjarke, B.: Experiences with the design and implementation of space-efficient deques. In: 5th International Workshop on Algorithm Engineering, Volume 2141 of Lecture Notes in Computer Science, pp. 39–50. Springer (2001)

  42. Kernighan, B.W., Ritchie, D.M.: The C Programming Language, 2nd edn. Prentice Hall PTR, Hoboken (1988)

    MATH  Google Scholar 

  43. Knuth, D.E.: Sorting and Searching, Volume 3 of The Art of Computer Programming, 2nd edn. Addison Wesley, Longman (1998)

    Google Scholar 

  44. Knuth, D.E.: Combinatorial Algorithms: Part 1, Volume 4A of The Art of Computer Programming. Addison-Wesley, Longman (2011)

    MATH  Google Scholar 

  45. Koren, I.: Computer Arithmetic Algorithms, 2nd edn. A. K. Peters, Ltd, Natick (2002)

    MATH  Google Scholar 

  46. Mehta, H., Owens, R.M., Irwin, M.J.: Some issues in Gray code addressing. In: 6th Great Lakes Symposium on VLSI, pp. 178–181. IEEE Computer Society (1996)

  47. Metze, G., Robertson, J.E.: Elimination of carry propagation in digital computers. In: International Conference on Information Processing, pp. 389–396. UNESCO (1960)

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

    Article  MathSciNet  Google Scholar 

  49. Okasaki, C.: Simple and efficient purely functional queues and deques. J. Funct. Program. 5(4), 583–592 (1995)

    Article  Google Scholar 

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

    Book  Google Scholar 

  51. O’Neill, M.E., Burton, F.W.: A new method for functional arrays. J. Funct. Program. 7(5), 487–513 (1997)

    Article  MathSciNet  Google Scholar 

  52. Parhami, B.: Generalized signed-digit number systems: a unifying framework for redundant number representations. IEEE Trans. Comput. 39(1), 89–98 (1990)

    Article  Google Scholar 

  53. Parhami, B.: Computer Arithmetic: Algorithms and Hardware Designs, 2nd edn. Oxford University Press, Oxford (2009)

    Google Scholar 

  54. Rahman, M.Z., Munro, J.I.: Integer representation and counting in the bit probe model. Algorithmica 56(1), 105–127 (2010)

    Article  MathSciNet  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

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

    Article  Google Scholar 

Download references

Acknowledgements

We would like to thank the editor and the reviewers for thoroughly reading the paper and for their valuable comments that contributed in enhancing the writeup.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Amr Elmasry.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Jyrki Katajainen has passed away after the submission of the first version of the paper to the journal.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Elmasry, A., Katajainen, J. Regular numeral systems for data structures. Acta Informatica 59, 245–281 (2022). https://doi.org/10.1007/s00236-021-00407-9

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00236-021-00407-9

Navigation