What is the name of this tree?
Posted
by
Daniel
on Programmers
See other posts from Programmers
or by Daniel
Published on 2012-03-19T16:59:26Z
Indexed on
2012/03/19
18:13 UTC
Read the original article
Hit count: 313
data-structures
It has a single root and each node has 0..N ordered sub-nodes . The keys represent a distinct set of paths. Two trees can only be merged if they share a common root. It needs to support, at minimum: insert, merge, enumerate paths.
For this tree:
The +-------+----------------+ | | | cat cow dog + +--------+ + | | | | drinks jumps moos barks + | milk
the paths would be:
- The cat drinks milk
- The cow jumps
- The cow moos
- The dog barks
It's a bit like a trie. What is it?
© Programmers or respective owner