|
|
|
|
|
by mypalmike
2852 days ago
|
|
Radix trees are great for IP address databases. With a couple of additional operations, this could be used as the basis of such a database. Making certain assumptions about the implementation here... Keys would be the string representation of the binary version of the CIDR (e.g. "10.0.0.0/12" -> "000010100000"). Searching for best fit involves traversing down the tree until finding the deepest terminating node that matches. Parent prefix is same as equality while keeping track of previous terminating node. Immediate child prefixes requires depth-first traversal of child nodes until hitting a terminal node. |
|