I’m looking for a tree implementation that has functionality that allows you to insert a child at a given location. Most trees out there, you can only do plain old insert, Tree.insert(x), and depending on the tree type, it goes to a particular tree location.
I seek code that supports something like Tree.insert(node, x), which means to make x the direct child of node
IF anyone knows of a somewhat efficient tree source code (C++ or C) that doesn’t use the STL and satifies the above, it would be greatly appreciated.
Check out
tree.hh, which provides an STL-like tree interface. There areinsertandappend_childmember functions that accept an iterator and a value to insert, just as you describe. Unless you have very specialised needs, it’s almost certainly sufficient performancewise.