Preorder Tree Traversal in Python

In this article, we will study the concept and algorithm for preorder tree traversal. Then we will implement the algorithm for preorder traversal in Python and run it on a binary tree. What is Preorder Tree Traversal? Preorder traversal is a depth-first tree traversal algorithm. In depth-first traversal, we start at the root node and […]

Preorder Tree Traversal in Python Read More »

Balanced Binary Tree in Python

In this article, we will study balanced binary trees and we will try to implement a program in Python to determine if a binary tree is balanced or not. To read this article, you should be familiar with the concept of binary trees. What is a Balanced Binary Tree? A balanced binary tree is defined

Balanced Binary Tree in Python Read More »

Decorators in Python [Explained]

Let’s talk about a niche topic today – Decorators in Python. This is a simple but powerful tool that, as the name suggests, decorates functions. Pre-Requisite knowledge There are a few concepts we need to know before proceeding with Decorators in Python, namely, higher-order functions and nested functions – two sides of the same coin.

Decorators in Python [Explained] Read More »

Python classmethod()

Python classmethod() is a built-in function of the Python standard library! There are three types of methods in Python: Instance Method Class Method Static Method Here, in this article, we’re going to discuss and focus on the class method of Python. So let’s get started. What is a Python classmethod()? A Python classmethod() can be

Python classmethod() Read More »