Quote:
Originally Posted by titaniumdecoy
Binary trees have a worst-case insert time of ) , so your solution most likely does not satisfy the problem requirements. (Unless you kept the tree balanced somehow, as Sane suggested.)
|
No, it was just a simple binary tree - I didn't see anything in the problem requirements in the PDF about O(nlogn), just Sane's assertion that a N^2 algorithm can't finish it. Clearly, that is not the case.