开发者

Using a modified Radix Tree for implementing a URL matching algorithm

I am refactoring this algori开发者_如何学Gothm completely. Basically I am re-implementing the ASP.NET MVC in C++ for another framework. I'm trying to implement a URL matching algorithm and I figured that radix tree would be the best choice for the keys searching because some url prefixes might be shared.

Also searching may be very efficient considering this example:

tree.getPrefix("home/");

This should output all the actions that home can perform.

Also if home is not found it should try to match an inputted pattern in the tree (see ASP.MVC for examples).

If only a part of the URL matches it should use the default.

Is it a good idea to implement it this way?

How would the new algorithm look like?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜