*2.4. DACs*

This section describes DACs which is used in *k*2-raster to directly access variable-length codes. Based on the concept of compact data structures, DACs were proposed in the papers published by Brisaboa et al. in 2009 and 2013 [23,24] and the structure was proven to yield good compression ratios for variable-length integer sequences. By means of the rank function, it gains fast direct access to any position of the sequence in a very compact space. The original authors also asserted that it was better suited for a sequence of integers with a skewed frequency distribution toward smaller integer values.

Different types of encoding are used for DACs and the one that we are interested in for *k*2-raster is called Vbyte coding. Consider a sequence of integers *x*. Each integer, which is represented by log2*xi* + 1 bits, is broken into blocks of bits of size *S*. Each block is stored as a chunk of *S* + 1 bits. The chunk that holds the most significant bits has the highest bit set to 0 while the other chunks have their highest bit set to 1. For example, if we have an integer 20 (101002) which is 5 bits long and if the block size is *S* = 3, then we can have 2 chunks denoted by the following: 0010 1100.

To show how the chunks are organized and stored, we again illustrate it with an example. If we have 3 integers of variable length 20 (101002), 6 (1102), 73 (10010012) and each block size is 3, then the three integers have the following representations.

20 0010 1100 (B1,2A1,2 B1,1A1,1)

```
6 0110 (B2,1A2,1)
```
73 0001 1001 1001 (B3,3A3,3 B3,2A3,2 B3,1A3,1)

We will store them in three chunks of arrays *A* and bitmaps *B*. This is depicted in Figure 8. To retrieve the values in the arrays *A*, we make use of the corresponding bitmaps *B* with the rank function.

More information on DACs and the software code can be found in the papers [23,24].


**Figure 8.** Organization of 3 Directly Addressable Codes (DACs) clusters.
