This is related to 开发者_如何学JAVAParse Url Strings into Tree Hierarchy
But i'm implementing in javascript, therefore require some algorithm here instead of using SQL functions.
Prefix tree/Trie or Suffix Tree
It is really difficult to suggest one over the other unless you specify the sort of operations you intend to perform over and above organising them.
精彩评论