Making Data Trees in Python

Learn about trees and how to implement them.

Keno Leon
The Startup
Published in
10 min readFeb 25, 2020

--

Roots

A tree as a data structure can quickly become a complex mathematical subject ( check the wiki 👀 ), we are surrounded by real and virtual things (data really) that can be modeled and represented by a tree, so it is a very handy subject to understand even at a basic level.

Personally, I recently failed a code interview question due to my lack of experience with trees in python, is not that a tree is hard to understand, but implementing it on the other hand, specifically in python from scratch is where I stumbled, I hope that by the end of this post both you and I will understand the subject at a comfortable level, and of course be able to implement one for code interviews and other needs.⏭ ⏭ In a hurry ?If you know the theory and/or just want a working tree implementation in Python you can jump to the later sections and skip the theory.👋👋 Hi there 👋👋 all my content is free for Medium subscribers, if you are already a subscriber I wanted to say thank you ! 🎉 If not and you are considering subscribing, you can use my membership referral link, you will be supporting this and other high quality content, Thank you !⭐️⭐ Subscribe to Medium ! ⭐️⭐️

--

--