Digital Search Tree

# Trytobuildthedigitalsearch trytobuildthedigitalsearch

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: fference is that the subtree to move to is determined by a bit in the search key rather than by the result of the comparison of the search key and the key in the current node. Try to build the digital search Try to build the digital search tree A S E R C H I N G X M P 00001 10011 00101 10010 00011 01000 01001 01110 00111 11000 01101 10000 Digital Search Tree Digital A S E C R H GI N M P X Practical Practical When we dealing with very long keys, the cost of a key comparison is high. We can reduce the number of key comparisons to one by using a related structure called Patricia We shall develop this structure in three steps. First, we introduce a structure called a binary trie. Then we transform binary tries into compressed binary tries. Finally, from compressed binary tries we obtain Patricia. Binary Tries Binary Tries A binary trie is a binary tree that has two kinds of nodes: branch nodes and element branch and nodes. nodes A branch node has the two data members LeftChild and RightChild. It has no data member. An element node has the single data member data. Branch nodes are used to build a binary tree search structure similar to that of a digital search tree. This leads to element nodes A six­element binary trie 1100 0010 0000 0001 1000 1001 Compressed binary trie The binary trie contains branch nodes whose degree is one. By adding another data member, BitNumber , to each branch node, we can eliminate all degree­one branch nodes from the trie. The...
View Full Document

## This note was uploaded on 02/07/2014 for the course CSE 100 taught by Professor Staff during the Summer '08 term at UCSD.

Ask a homework question - tutors are online