Notes
Slide Show
Outline
1
Searching with Structured Keys
Objectives
  • 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
Radix Sorting Technique
4
Radix Searching Techniques
5
Digital Search Trees
6
 
7
Digital Search Tree Updates
8
Digital Search Tree Updates
9
Digital Search Trees - Costs
  • 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
Radix Search Tries
“trie” as in “retrieval” is pronounced “try”
11
Radix Search Trie Updates
  • 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"
  • Only n nodes of storage
  • Just one full key compare
  • No “useless” tests


13
Patricia:  Step 1
Leave out 1 way branch nodes
  • Add to each node the position of the bit to be tested (we will still move left to right)
14
"Patricia:"
  • 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
Patricia Insertions
  • 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
Radix Techniques
  • Insensitive to order of insertions
  • Sensitive to particular value
  • Very useful for long or variable length keys