I’m a beginner with Python and I’m trying to learn user-defined data structures. I’m confused why one would ever want to use an array implementation of a binary tree. It’s equally time efficient and less memory efficient than classes. The only use cases I can think of seem far too obscure to be put on a free learn-to-code site.
So, in what scenario could an array implementation of a binary tree be better than both a regular list (you can just use binary search!) and a normal class implementation?
Lucas Grenier is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.