I have to implement a binary tree in Python. One node of a tree have several attributes. One of my requirements is a minimum of memory usage, specifically the overhead of the data structures.
So my question is, how much overhead is produced by different ways of the implementation. I think about using a dictionary where one key is "left" and another is "right" for the child nodes. Another way would be by using a class with the attributes "left" and "right" for the children.
Are there any noticable advantages or disadvantages for these two options? Or are there any better options?
I'll have to use Pythons standard library and I'm using Python 3.5.