Given: binary tree (tree algorithm is written by hand). Number S. It is necessary to find a sequence of nodes (only from top to bottom or vice versa) in a binary tree, the sum of which is equal to S.
For example: there is a binary tree, and the number S = 9. 
Solution: 3 + 6, 4 + 5, 9.
ps it is desirable that this be a separate class that has access to the binTree class
#pragma once class binTree { protected: struct Node { int Value; Node * pLeft; Node * pRight; Node * pParent; Node(int x) :Value(x), pLeft(NULL), pRight(NULL), pParent(NULL) {} }; Node * m_pRoot; void InoderTreeWalk(Node * x); Node * TreeSuccessor(Node *x); Node * TreeMin(Node * x); public: binTree(); ~binTree(); virtual void TreeInsert(int k); Node * TreeSearch(Node * X, int k); void ShowTree(); int Root(); };