How to Implement a Complete Binary Tree in Python Correctly