lets say i have some int values
for example 1;2;4;7;8
which one is the best way to determine in what order should i insert the int numbers in the 2-3 tree for having the fewer possible nodes
lets say i have some int values
for example 1;2;4;7;8
which one is the best way to determine in what order should i insert the int numbers in the 2-3 tree for having the fewer possible nodes
I guess normally, you would have no prior knowledge of the list of numbers to be added, so in effect you add the numbers as they arrive and perform one (or more) rebalancing operations on the constructed tree.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.