largest complete subtree in a binary tree
问题 I am defining a complete subtree as a tree with all levels full and the last level left justified i.e. all nodes are as far left as possible, and I want to find the largest subtree in a tree that is complete. One method is to do the method outlined here for every node as root, which would take O(n^2) time. Is there a better approach? 回答1: Since there isn't a C++ solution above, I have added my solution. Let me know if you feel there is anything incorrect or any improvements that can be made.