Using the Modified Radix Tree to Implement the URL Matching Algorithm

I will completely reorganize this algorithm. I mainly reprogram ASP.NET MVC in C ++ for a different structure. I am trying to implement a URL mapping algorithm, and I decided that the radix tree would be the best choice for finding keys, as some URL prefixes might be split.
Also, a search can be very effective given this example:

tree.getPrefix("home/"); 

This should output all the actions that the house can perform.
In addition, if home is not found, it should try to match the entered pattern in the tree (see ASP.MVC Examples).
If only part of the URL matches, it should use the default value.
Is it a good idea to implement it this way?
What does the new algorithm look like?

+4
source share

Source: https://habr.com/ru/post/1299747/


All Articles