Далее следует вопрос интервью.
You are given a binary tree (not necessarily BST) in which each node contains a value. Design an algorithm to print all paths which sum up to that value. Note that it can be any path in the tree - it does not have to start at the root.
Хотя я могу найти все пути в дереве, которые начинаются с корня, имеют заданную сумму, я не могу сделать это для путей, не начинающихся с корня.