I am currently pursuing Bachelor of Technology and MBA (dual degree) in Information Technology from Indian Institute of Information Technology. I love teaching and writing articles on computer science and related topics.

## How to Delete a Binary Tree in Python?

We have already discussed binary trees and binary search trees in previous posts. In this article, we will formulate an algorithm to Delete a Binary Tree without causing a memory leak. We will also implement the algorithm in Python. What is memory leak? Memory leak in a program occurs when we allocate memory to a […]

## Find maximum width of a Binary Tree

In this article, we will modify the level order tree traversal algorithm to find the maximum width of a binary tree. In the previous post on balanced binary trees, we have formulated and implemented an algorithm to find the height of a binary tree. We have also implemented an algorithm for level order binary tree traversal

## Find the sum of all nodes in a binary tree

In this article, we will use this algorithm to find the sum of all nodes in a binary tree. We have already discussed the Level Order Binary Tree Traversal in Python. How to find the sum of all nodes in a binary tree? To find the sum of all nodes in a binary tree, we

## Calculating the Distance Between Nodes in an Unweighted Graph

Graph traversal algorithms have various applications. One of the applications is to find the least distance between two nodes of a graph. In this article, we will implement an algorithm to find the least distance in an unweighted, fully connected graph in python using breadth-first graph traversal algorithm. Using The BFS Algorithm for a GRaph

## Depth-first search in a graph

Depth-first search is a traversal technique in which we traverse a graph and print the vertices exactly once. In this article, we will study and implement the depth-first search for traversing graphs in python. Recommended read: Implementing a graph in Python What is the Depth-First Search Algorithm? In a depth-first search, we traverse each vertex

## Breadth-First Search in a Graph

Breadth-first search is a traversal technique in which we traverse a graph and print the vertices exactly once. In this article, we will study and implement the breadth-first search for traversing graphs in python. What is the Breadth-First Search Algorithm? In breadth-first search, we traverse each vertex of the graph exactly once by starting from

## Graph Operations in Python [With Easy Examples]

In this article, we will discuss how to perform different graph operations. Graphs are nonlinear data structures that consist of vertices and edges. They’re used to represent maps between cities, social media connectivity of users, and connectivity of web pages, etc. Working on Graph Operations If you have not studied the implementation of a graph,

## Implementing a Graph in Python

A graph is a data structure used to illustrate connections between two objects. A simple example of a graph is a geographical map in which different places are connected by roads. In this article, we will study the theoretical aspects of a graph data structure. Additionally, we will implement a graph using two different methods.

## Min Heap Data Structure – Complete Implementation in Python

In this article, we will learn more about Min Heap (known as heap queue in Python). We have already learned about Heap and its library functions (in heapq module) in python. We will now learn about min-heap and its implementation and then look at the Python code for implementing the heapify, heappush and heappop functions

## Max Heap Data Structure – Complete Implementation in Python

In this article, we will learn more about Max Heap (known as heap queue in Python). We have already learned about Heap and its library functions (in heapq module) in python . We will now learn about max heap and its implementation and then look at the Python code for implementing the heapify, heappush and