質問

http://en.wikipedia.org/wiki/Radix_tree So instead of a function i used an integer value instead for isLeaf. But how many elements should an array of edges have? How many children max for each node?

役に立ちましたか?

解決

That depends on your radix. The maximum number of children of a node is the number of possible unique values of the chosen discriminator; if you use a character for the discriminator, then the maximum number of children will be the number of valid characters.

You can implement this data-structure with a radix of two, by discriminating on each bit; in this case, your trees will be deeper but each non-leaf node will have exactly two children, which might simplify the implementation.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top