Keywords and Synonyms
Binary bit-vector ; Compressed bit-vector, Rank and select dictionary; Fully indexable dictionary (FID)
Problem Definition
Given a static sequence \( \boldsymbol{b} = b_1 \dots b_m \) of m bits, to preprocess the sequence and to create a space-efficient data structure that supports the following operations rapidly:
- \( \mathsf{rank_1} (i) \) :
-
takes an index i as input, \( 1 \le i \le m \), and returns the number of 1s among \( b_1 \dots b_i \).
- \( \mathsf{select_1} (i) \) :
-
takes an index \( i \ge 1 \) as input, and returns the position of the ith 1 in \( \boldsymbol{b} \), and −1 if i is greater than the number of 1s in \( \boldsymbol{b} \).
The operations rank 0 and select 0 are defined analogously for the 0s in \( \boldsymbol{b} \). As \( \mathsf{rank_0} (i) = i - \mathsf{rank_1} (i) \), one considers just rank 1 (abbreviated to rank), and refers to select 0 and select 1 collectively as select. In what follows, |x| denotes the length of a bit sequence x and w(x...
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
For compressed bit-vectors, the ‘lower-order’ o(m) or o(n) term can dominate \( B(m,n) \), but this is not our concern here.
Recommended Reading
Aho, A.V., Hopcroft, J.E., Ullman, J.D.: The Design and Analysis of Computer Algorithms. Addison-Wesley (1974)
Clark, D., Munro, J.I.: Efficient suffix trees on secondary storage. In: Proc. 7th ACM-SIAM SODA, pp. 383–391 (1996)
Delpratt, O., Rahman, N., Raman, R.: Engineering the LOUDS succinct tree representation. In: Proc. WEA 2006. LNCS, vol. 4007, pp. 134–145. Springer, Berlin (2006)
Delpratt, O., Rahman, N., Raman, R.: Compressed prefix sums. In: Proc. SOFSEM 2007. LNCS, vol. 4362, pp. 235–247 (2007)
Elias, P.: Efficient storage retrieval by content and address of static files. J. ACM, 21(2):246–260 (1974)
Ferragina, P., Venturini, R.: A simple storage scheme for strings achieving entropy bounds. Theor. Comput. Sci. 372, 115–121 (2007)
Geary, R.F., Rahman, N., Raman, R., Raman, V.: A simple optimal representation for balanced parentheses. Theor. Comput. Sci. 368, 231–246 (2006)
Golynski, A.: Optimal lower bounds for rank and select indexes. In: Proc. ICALP 2006, Part I. LNCS, vol. 4051, pp. 370–381 (2006)
González, R., Navarro, G.: Statistical encoding of succinct data structures. In: Proc. CPM 2006. LNCS, vol. 4009, pp. 294–305. Springer, Berlin (2006)
Jacobson, G.: Space-efficient static trees and graphs. In: Proc. 30th FOCS, pp. 549–554 (1989)
Kim, D.K., Na, J.C., Kim, J.E., Park, K.: Efficient implementation of Rank and Select functions for succinct representation. In: Proc. WEA 2005. LNCS, vol. 3505, pp. 315–327 (2005)
Munro, J.I., Srinivasa Rao, S.: Succinct representation of data structures. In: Mehta, D., Sahni, S. (eds.) Handbook of Data Structures with Applications, Chap 37. Chapman and Hall/CRC Press (2005)
Okanohara, D., Sadakane, K.: Practical entropy-compressed rank/select dictionary. In: Proc. 9th ACM-SIAM Workshop on Algorithm Engineering and Experiments (ALENEX '07), SIAM, to appear (2007)
Pagh, R.: Low redundancy in static dictionaries with constant query time. SIAM J. Comput. 31, 353–363 (2001)
Patrascu, M., Thorup, M.: Time-space trade-offs for predecessor search. In: Proc. 38th ACM STOC, pp. 232–240 (2006)
Raman, R., Raman, V., Rao, S.S.: Succinct indexable dictionaries, with applications to representing k-ary trees and multisets. In: Proc. 13th ACM-SIAM SODA, pp. 233–242 (2002)
Sadakane, K., Grossi, R.: Squeezing succinct data structures into entropy bounds. In: Proc. 17th ACM-SIAM SODA, pp. 1230–1239. ACM Press (2006)
Witten, I., Moffat, A., Bell, I.: Managing Gigabytes, 2nd edn. Morgan Kaufmann (1999)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2008 Springer-Verlag
About this entry
Cite this entry
Rahman, N., Raman, R. (2008). Rank and Select Operations on Binary Strings. In: Kao, MY. (eds) Encyclopedia of Algorithms. Springer, Boston, MA. https://doi.org/10.1007/978-0-387-30162-4_332
Download citation
DOI: https://doi.org/10.1007/978-0-387-30162-4_332
Publisher Name: Springer, Boston, MA
Print ISBN: 978-0-387-30770-1
Online ISBN: 978-0-387-30162-4
eBook Packages: Computer ScienceReference Module Computer Science and Engineering