Let's say we have a basic binary tree, capable of being searched recursively:
class BinaryTree{
private int Element;
private BinaryTree LeftNode;
private BinaryTree RightNode;
//Class Constructors
//Class Methods
}
I initially learned this design of binary tree and a general tree mainly because it was simple and easy to use. However, someone discussed that with this design, every time i would expand the tree, a.k.a add an instance of BinaryTree to LeftNode or RightNode, the instantiating of another BinaryTree would also require reserving memory space to store all non-static methods of the class BinaryTree. As the tree grows exponentially, the amount of space required would also increase largely.
Is there a more efficient way to implement a recursive tree design, while staying true to object-oriented paradigms?