Tree Insertion4 Binary Search Tree Designs (ppt)Simple Tree2 class contruction.The simplest and most common design but perhaps the hardest to debug as errors almost always require fixing twice. Once on the left, and once on the right. Sample Tree3 class contruction.Eliminates the repetition by adding a level of indirection. Another Tree2 class contruction.Eliminates the repetition using return values instead of a third class. Probably harder to implement as the return values require some thought. Yet Another Tree1 class contruction.Eliminates the repetition by changing the empty tree from null to a tree node with null data. This is perhaps the only pure object oriented design of the bunch. More designs are possibleA parent pointer can change the design and/or the abstraction |