I've already seen this solution and this is not exactly I am looking for. It shouldn't be based on an actual file but just use the binary tree as storage. Please see some example codes for this below: struct TreeNode { int value; TreeNode *left; TreeNode *right; }; class IntBinaryTree { public: struct TreeNode { int value; TreeNode *left; TreeNode *right; };.