Compressed ternary mask system and method
First Claim
Patent Images
1. A searching method, comprising:
- providing a search tree having a root node, one or more branch nodes wherein each branch node has one or more leaf nodes containing data values to be matched and a mask value of the data, each branch node of the tree further comprising a value indicating the leaf values in the branch node and a compressed ternary mask for each branch node of the tree, the compressed ternary mask further comprising extracting the most significant bit of each mask contained in the branch node and logically ORing the most significant bits of the each mask together to generate the compressed ternary mask which represents the masks for all of the leaf nodes on the branch node of the tree;
selecting a branch node by comparing a key value to the value associated with each branch node;
comparing the key value to the values of the leaf nodes of the selected branch node to identify a matching value; and
if the leaf node value of the selected branch node does not match the key value, comparing the key value to the compressed ternary masks for the other branch nodes of the tree to identify a best match for the key value.
1 Assignment
0 Petitions
Accused Products
Abstract
A compressed ternary mask system and method is described. The system and method compresses masks in a search tree such that a single comparison may be completed for each branch level of the tree. In a preferred embodiment, a tree having a root level, a 2nd level and a leaf level may be used to implement the method.
57 Citations
1 Claim
-
1. A searching method, comprising:
-
providing a search tree having a root node, one or more branch nodes wherein each branch node has one or more leaf nodes containing data values to be matched and a mask value of the data, each branch node of the tree further comprising a value indicating the leaf values in the branch node and a compressed ternary mask for each branch node of the tree, the compressed ternary mask further comprising extracting the most significant bit of each mask contained in the branch node and logically ORing the most significant bits of the each mask together to generate the compressed ternary mask which represents the masks for all of the leaf nodes on the branch node of the tree;
selecting a branch node by comparing a key value to the value associated with each branch node;
comparing the key value to the values of the leaf nodes of the selected branch node to identify a matching value; and
if the leaf node value of the selected branch node does not match the key value, comparing the key value to the compressed ternary masks for the other branch nodes of the tree to identify a best match for the key value.
-
Specification