Programming with Judy
The Judy Advantage
Compared with Other Search and Retrieval Methods
Chapter 218
Compared with Other Search and Retrieval
Methods
The table below shows how Judy algorithms compare with other search
and retrieval methods.
Table 2-1
Search and
Retrieval
method (data
structure)
O number
for lookup
Advantages Disadvantages
Arrays Fast indexing Pre-allocation of entire array
before storing a single element
(inefficient for sparse arrays).
Hashing Depends on
algorithm
Fast access
• Synonym management is
complex.
• No near-neighbor lookup
capability.
• Must be tuned for size and
nature of data being stored.
Binary Trees O(log n) Gets very deep with large data
sets, requiring many memory
accesses to reach target values.
AVL Trees
(height-balanced
binary trees)
O(log n)
• Expensive to keep balanced.
• May also get very deep with
large data sets, requiring
many memory accesses to
reach target values.
B-trees O(log n)
• Slow to access.
• Inherently difficult to balance.