Posts by Tags

algorithms

Graphs: A Comprehensive Guide

6 minute read

Published:

Graph problems are a fundamental part of computer science and are frequently encountered in competitive programming and technical interviews. They require a good understanding of graph theory and the ability to recognize various problem patterns. In this post, we’ll explore different types of graph problems, the patterns they follow, and some example problems to practice.

Binary Trees: A Comprehensive Guide

15 minute read

Published:

Binary trees are a fundamental data structure in computer science, often used in various applications ranging from databases to operating systems. Understanding the different types of problems and patterns associated with binary trees is essential for anyone looking to master data structures and algorithms. In this guide, we will explore key binary tree problem patterns and provide examples for each.

backtracking

Backtracking : A Comprehensive Guide

6 minute read

Published:

Backtracking is a powerful algorithmic technique for solving problems related to permutations, combinations, and subsets. The essence of backtracking lies in exploring all potential solutions and then backtracking by undoing the last decision and trying the next possibility. Below is a generalized template for backtracking that can be adapted to a variety of problems like subsets, permutations, and combinations.

binary-tree

Binary Trees: A Comprehensive Guide

15 minute read

Published:

Binary trees are a fundamental data structure in computer science, often used in various applications ranging from databases to operating systems. Understanding the different types of problems and patterns associated with binary trees is essential for anyone looking to master data structures and algorithms. In this guide, we will explore key binary tree problem patterns and provide examples for each.

coding-patterns

Coding Patterns: A Comprehensive Guide

6 minute read

Published:

This post includes some popular problems sorted according to the different patterns. This list excludes tree or graph related BFS and DFS, and dynamic programming. I feel that those topics require their own posts!

841: Keys and Rooms

3 minute read

Published:

You are given n rooms labeled from 0 to n - 1, and all the rooms are locked except for room 0. Your goal is to visit all the rooms, but you cannot enter a locked room without having its key.

dfs

841: Keys and Rooms

3 minute read

Published:

You are given n rooms labeled from 0 to n - 1, and all the rooms are locked except for room 0. Your goal is to visit all the rooms, but you cannot enter a locked room without having its key.

802: Find Eventual Safe States

4 minute read

Published:

Given a directed graph with n nodes labeled from 0 to n - 1, we need to identify all the safe nodes in the graph. A node is considered safe if every possible path starting from that node leads to a terminal node or another safe node. A terminal node is defined as a node that has no outgoing edges.

dynamic-programming

Dynamic Programming Pattern: Knapsack-like

6 minute read

Published:

This pattern has two sub-patterns namely, 0-1 Knapsack and Unbounded Knapsack. Together, the type of problems that match these patterns are called “Knapsack-like” problems.

Study Plan: Dynamic Programming

3 minute read

Published:

This page is continually updated with new and improved content to ensure the best curation for Dynamic Programming problems.

graph

841: Keys and Rooms

3 minute read

Published:

You are given n rooms labeled from 0 to n - 1, and all the rooms are locked except for room 0. Your goal is to visit all the rooms, but you cannot enter a locked room without having its key.

802: Find Eventual Safe States

4 minute read

Published:

Given a directed graph with n nodes labeled from 0 to n - 1, we need to identify all the safe nodes in the graph. A node is considered safe if every possible path starting from that node leads to a terminal node or another safe node. A terminal node is defined as a node that has no outgoing edges.

graph-coloring

802: Find Eventual Safe States

4 minute read

Published:

Given a directed graph with n nodes labeled from 0 to n - 1, we need to identify all the safe nodes in the graph. A node is considered safe if every possible path starting from that node leads to a terminal node or another safe node. A terminal node is defined as a node that has no outgoing edges.

graphs

Graphs: A Comprehensive Guide

6 minute read

Published:

Graph problems are a fundamental part of computer science and are frequently encountered in competitive programming and technical interviews. They require a good understanding of graph theory and the ability to recognize various problem patterns. In this post, we’ll explore different types of graph problems, the patterns they follow, and some example problems to practice.

knapsack

Dynamic Programming Pattern: Knapsack-like

6 minute read

Published:

This pattern has two sub-patterns namely, 0-1 Knapsack and Unbounded Knapsack. Together, the type of problems that match these patterns are called “Knapsack-like” problems.

leetcode

Backtracking : A Comprehensive Guide

6 minute read

Published:

Backtracking is a powerful algorithmic technique for solving problems related to permutations, combinations, and subsets. The essence of backtracking lies in exploring all potential solutions and then backtracking by undoing the last decision and trying the next possibility. Below is a generalized template for backtracking that can be adapted to a variety of problems like subsets, permutations, and combinations.

Dynamic Programming Pattern: Knapsack-like

6 minute read

Published:

This pattern has two sub-patterns namely, 0-1 Knapsack and Unbounded Knapsack. Together, the type of problems that match these patterns are called “Knapsack-like” problems.

841: Keys and Rooms

3 minute read

Published:

You are given n rooms labeled from 0 to n - 1, and all the rooms are locked except for room 0. Your goal is to visit all the rooms, but you cannot enter a locked room without having its key.

802: Find Eventual Safe States

4 minute read

Published:

Given a directed graph with n nodes labeled from 0 to n - 1, we need to identify all the safe nodes in the graph. A node is considered safe if every possible path starting from that node leads to a terminal node or another safe node. A terminal node is defined as a node that has no outgoing edges.

Graphs: A Comprehensive Guide

6 minute read

Published:

Graph problems are a fundamental part of computer science and are frequently encountered in competitive programming and technical interviews. They require a good understanding of graph theory and the ability to recognize various problem patterns. In this post, we’ll explore different types of graph problems, the patterns they follow, and some example problems to practice.

Binary Trees: A Comprehensive Guide

15 minute read

Published:

Binary trees are a fundamental data structure in computer science, often used in various applications ranging from databases to operating systems. Understanding the different types of problems and patterns associated with binary trees is essential for anyone looking to master data structures and algorithms. In this guide, we will explore key binary tree problem patterns and provide examples for each.

Coding Patterns: A Comprehensive Guide

6 minute read

Published:

This post includes some popular problems sorted according to the different patterns. This list excludes tree or graph related BFS and DFS, and dynamic programming. I feel that those topics require their own posts!

Study Plan: Dynamic Programming

3 minute read

Published:

This page is continually updated with new and improved content to ensure the best curation for Dynamic Programming problems.

recursion

841: Keys and Rooms

3 minute read

Published:

You are given n rooms labeled from 0 to n - 1, and all the rooms are locked except for room 0. Your goal is to visit all the rooms, but you cannot enter a locked room without having its key.

sql