Programming with Judy

Using Judy
Chapter 3 25
3 Using Judy
The Judy library functions support small or large, dynamic arrays with
32- or 64-bit indexes depending on the processor type. Each type of Judy
array has a different kind of index and/or value. You can think of a Judy
array as:
Judy arrays are quick to access and space efficient. A Judy array is
created by storing (inserting) the first element and grows dynamically as
elements are inserted.
The table below summarizes the Judy array types with functions
provided. The Judy header file (Judy.h) provides definitions for these
functions; the constants NULL, TRUE, and FALSE; and the macro
equivalents for calling Judy functions.
value-type JudyArray [4294967296];
// or 2
32
on a 32-bit processor
value-type JudyArray [18446744073709551616];
// or 2
64
on a 64-bit processor
Table 3-1 A summary of Judy functions
Judy Array Type
Function Judy1: maps
ulong_t to bit
JudyL: maps
ulong_t to ulong_t
JudySL: maps
string to ulong_t
Retrieve Judy1Test JudyLGet JudySLGet
Set Judy1Set JudyLIns JudySLIns
Clear/Delete Judy1Unset JudyLDel JudySLDel
First Index Judy1First JudyLFirst JudySLFirst
Last Index Judy1Last JudyLLast JudySLLast
Previous Index Judy1Prev JudyLPrev JudySLPrev
Next Index Judy1Next JudyLNext JudySLNext