This preview shows page 1. Sign up to view the full content.
Unformatted text preview: BitNumber data member of a branch node gives the bit number of the key that is to be used at this node. Binary trie with degreeone Binary trie with degreeone nodes eliminated 1 3 2 4 4
0010 0000 0001 1100
1000 1001 Patricia
Patricia Compressed binary tries may be represented using nodes of a single type. The new nodes, called augmented branch nodes, are the original branch nodes augmented by the data member data. The resulting structure is called Patricia and is Patricia and is obtained from a compressed binary trie in the following way: (1)Replace each branch node by an augmented branch node.
(2)Eliminate the element nodes.
(3)Store the data previously in the element node in the data data members of the augmented branch nodes. Since every nonempty compressed binary trie has one less branch node than it has element nodes, it is necessary to add one augmented branch node. This node is called the head node . the
. The remaining structure is the left subtree of the head node. The head node has BitNumber equal to zero. Its rightchild data member is not used. The assignment of data to augmented branch node is less than or equal to that in the parent of the element node that contained this data . (4)Replace the original pointers to element nodes by pointers to the respective augmented branch nodes. Patricia
Patricia 0 1100 1
0000 3 2
0010 1001 4 4 0001 1000 Patricia
Patricia
typedef struct patricia_tree *patricia;
struct patricia_tree {
int bit_number;
element data;
patricia left_child, right_child;
};
patricia ro...
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.
 Summer '08
 staff
 Data Structures

Click to edit the document details