4 ms·
I don't agree. The tree being balanced of not has not bearing on the solvability of the problem. Even a naive approach would work balanced or unbalanced and th
by mbrumlow 9y ago
I don't agree. The tree being balanced of not has not bearing on the solvability of the problem.
Even a naive approach would work balanced or unbalanced and that would be simply to pop the lowest value in the tree and construct your list until you run out of nodes.
The trick is to do it in O(n) time and use recursion.