0
votes
2answers
76 views

How to enumerate the internal nodes and leaves of a tree more elegantly?

Might there be a simpler way to write this code? I'd like to learn to write code more efficiently. ...
5
votes
1answer
96 views

Segment tree in Python3

I've implemented a Segment Tree in Python3: ...
3
votes
2answers
533 views

Returning a list of the values from the binary tree

I want to return a list of the values from the binary tree. Is there a shorter and more efficient way to write the method for numbers? ...