c++ - Is this how I should be understanding what a multiway tree is? -
i implement multi-way tree in c++, still not sure are. have read few documentations, still confused because of lack of pictures or visualization provided.
lets want 3 way tree, according online web notes means each node can have @ 3-1 = 2 elements , each node can have @ 3 children. below have drawn trees not sure if 3-way trees, can please verify understanding correctly? thank you!
also, if have 2 way tree, mean have binary tree well? o.o?
my understanding of multi-way tree number of subtrees can traversed single node.
+---+ | d | +---+ ^ | | +---+ +------+ +---+ | | <-- | root | --> | b | +---+ +------+ +---+ | | v +---+ | c | +---+
the diagram above shows multi-way tree because root has more 1 child.
usually 2 children per node (except leaf nodes) indicates binary trees.
there many different kinds of binary trees.
see b-tree , b*trees.
edit 1:
view:
+------------------------+ | root + +------------------------+ | | | | v v v v +---+ +---+ +---+ +---+ | | | b | | c | | d | +---+ +---+ +---+ +---+