|
1
|
- To look at search structures for variable length and multidimensional
keys.
- To understand several basic radix search techniques, their advantages
and disadvantages
- To look at range queries and partial match searches in multidimensional
structures.
|
|
2
|
|
|
3
|
|
|
4
|
|
|
5
|
|
|
6
|
|
|
7
|
|
|
8
|
|
|
9
|
- The number of nodes inspected in a search is, at most, the number of
leading bits needed to distinguish it from other keys
- For “randomly distributed” keys this should be Θ(log n), but if
keys agree on lead bits problems arise
- But, visiting each node involves a key comparison, this may be the bulk
of the cost
|
|
10
|
|
|
11
|
- If you “fall out”, hang a new node on there
- If you come to a leaf continue
the path in the tree
with
the two elements
until the bits differ
|
|
12
|
- Only n nodes of storage
- Just one full key compare
- No “useless” tests
|
|
13
|
- Add to each node the position of the bit to be tested (we will still
move left to right)
|
|
14
|
- Patricia: Step 2
- Add the “dummy value” 00000 (which is either not stored or stored in the
header).
- Store keys in internal nodes that are ancestors of their leaf positions
in the tree
|
|
15
|
- Insertions can be made in the natural way.
- Follow the search path of new leaf.
- Determine the highest number bit where new key and leaf key differ.
- Retrace search path to the point where a test on this bit could occur.
- Insert new node there with the node on the path to leaf node as one
child and a new leaf containing the new key
|
|
16
|
|
|
17
|
|
|
18
|
|
|
19
|
|
|
20
|
- Insensitive to order of insertions
- Sensitive to particular value
- Very useful for long or variable length keys
|