As an example, I have the following b-tree model with each node containing tag / value pairs. The tree indicates priority (or priority), with the root being the highest, right down to the leaves, as the lowest (but this is application specific). I want to merge the new tree section into the parent, with a new section containing potentially common tag / value pairs, right up to the node just above the node sheet (a completely duplicated new tree section just won't be merged). For instance.
Displays pairs of existing trees (tag, value):
A,0
,
B,1 B,2 B,3
,
C,1 C,2
New tree to merge:
A,0
|
B,3
,
C,1 C,2
Final merged tree:
A,0
,
B,1 B,2 B,3
,
C,1 C,2 C,1 C,2
Question: is there an elegant C ++ solution for this union of b-trees using std containers or perhaps using a library like boost? Thank.