在Patricia Trie中找到最长前缀搜索的算法/步骤

编程入门 行业动态 更新时间:2024-10-17 07:29:57
本文介绍了在Patricia Trie中找到最长前缀搜索的算法/步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在实施Patricia尝试IP前缀查找,我可以让代码用于完全密钥匹配,但是遇到前缀搜索的问题,当是其他密钥的前缀的密钥时,喜欢:

I am implementing Patricia tries for IP prefix lookup, I could get the code working for complete key match, but facing problems with prefix search, when there are keys which are prefixes of other keys, like:

1.2.3.0 1.2.0.0

在上述情况下,任何人都可以帮助我使用前缀搜索算法我应该将它们视为单独长度的键(即/ 24和16) ?

Can anyone help me with the algorithm for prefix searches in the above case Should I consider these as keys of separate length (i.e, /24 and 16) ?

推荐答案

看看Net-Patricia。这是Patricia trie用于查找IP地址的实现。接口是perl,但底层代码在C中。这是一个链接,但许多CPAN归档应该有它:

Take a look at Net-Patricia. This is an implementation of a Patricia trie to look up IP addresses. The interface is perl, but the underlying code is in C. Here is a link, but many CPAN archives should have it:

cpansearch.perl/src/PHILIPP/Net-Patricia-1.15_07 /libpatricia/​​patricia.c

更多推荐

在Patricia Trie中找到最长前缀搜索的算法/步骤

本文发布于:2023-10-26 18:34:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1531005.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:前缀   算法   最长   步骤   中找到

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!