Today in class, my professor posed an interesting question for us to think about before our next class. If you insert items that are in ascending order into a binary search tree, then you will build the worst possible tree since it will have the largest possible height. The question is:
How would you change the tree building process so that the tree is nearly balanced ?
Just something to think about, if anyone has any ideas that would be great!! Thanks in advance!!!
How would you change the tree building process so that the tree is nearly balanced ?
Just something to think about, if anyone has any ideas that would be great!! Thanks in advance!!!
Comment