Latest Articles

Island Perimeter Data Structures and Algorithms

Island Perimeter

 This solution seeks to find the perimeter of an island in a grid.  The problem considers a grid where each cell represents land (1) or wat…

Pacific Atlantic Waterflow Data Structures and Algorithms

Pacific Atlantic Waterflow

 In this solution, the aim is to find cells that can flow water to both the Pacific Ocean and the Atlantic Ocean. The problem considers a hei…

Clone Graph Data Structures and Algorithms

Clone Graph

Clone Graph We are given a graph represented by a collection of nodes and their neighbors. The goal is to clone this graph, creating a new graph w…

Number of Islands Data Structures and Algorithms

Number of Islands

Here's an explanation of the thought process behind the solution of counting the number of islands in a grid. Problem Understanding The pro…

Graph Data Structure Data Structures and Algorithms

Graph Data Structure

In this section, I explore the graph data structure, including its definition and properties. Understanding graphs is fundamental due to thei…

Binary Search Trees Data Structures and Algorithms

Binary Search Trees

A Binary Search Tree (BST) is a data structure that is used for efficient searching, insertion, and deletion of elements. It is a binary tree where e…

Balanced Binary Tree Data Structures and Algorithms

Balanced Binary Tree

  In this solution, we write code to determine if the Binary Tree is balanced or not. For this problem, a height-balanced binary tree is d…

Binary Side View Data Structures and Algorithms

Binary Side View

Binary Side View Let's solve the problem of obtaining the right side view of a binary tree. To achieve that, here's a breakdown of how …

River Sizes Data Structures and Algorithms

River Sizes

This challenge aims to come up with a solution that implements an algorithm to find the sizes of rivers in a 2D matrix. Problem Given a 2D matr…

Min Heap Construction Data Structures and Algorithms

Min Heap Construction

Min Heap Construction A MinHeap is a binary tree-based data structure where the value of each node is less than or equal to the values of its chil…