๐๏ธ 0-1 BFS Algorithm
0-1 BFS Algorithm
๐๏ธ 2D Matrix Graph Algorithms
A comprehensive guide to 2D DFS, 2D BFS, and 2D Dijkstra algorithms with code examples in JavaScript.
๐๏ธ AVL Tree
The implementation maintains the AVL tree properties:
๐๏ธ Advanced Algorithm Techniques
Euler Tour Technique (ETT)
๐๏ธ Breadth-First Search (BFS) for Trees
Breadth-First Search (BFS) for Trees
๐๏ธ Backtracking Algorithm
Backtracking Algorithm
๐๏ธ Binary Heap
A Binary Heap is a complete binary tree that satisfies the heap property. It is a data structure commonly used to implement priority queues. There are two main types of binary heaps: the min-heap and the max-heap.
๐๏ธ Binary Lifting
Binary lifting (also known as binary jumping or jump pointers) is an advanced algorithmic technique primarily used to solve problems involving tree traversal and finding ancestors in a tree data structure. It's particularly efficient for queries like "find the kth ancestor of a node" or "find the lowest common ancestor (LCA) of two nodes.
๐๏ธ Binary Search and Its Variants
Binary Search
๐๏ธ Binary Search Tree
Binary Search Tree (BST)
๐๏ธ Binary Search Tree (BST)
Basic Structure
๐๏ธ Bit Manipulation Basics
Bit Manipulation Basics
๐๏ธ BoyerโMoore Majority Vote Algorithm
BoyerโMoore Majority Vote Algorithm
๐๏ธ Bucket Sort
A detailed guide to understanding and implementing Bucket Sort.
๐๏ธ Cantor's Diagonalization and Knuth's Algorithms Guide
Cantor's Diagonalization
๐๏ธ Circular Buffer
A circular buffer, also known as a ring buffer, is a fixed-size data structure that operates in a circular manner, meaning that once the buffer reaches the end, it wraps around to the beginning. It is commonly used in situations where data is produced and consumed at different rates, such as in streaming data or buffering in IO operations.
๐๏ธ Combinations and Modular Inverse
1. Combinations
๐๏ธ Graham's Scan Algorithm & Convex Hull
Theory
๐๏ธ Counting Sort
A detailed guide to understanding and implementing Counting Sort.
๐๏ธ Cycle Detection in Graphs
Cycle detection is an essential aspect of graph theory, used to identify whether a graph contains cycles. This document outlines methods for detecting cycles in both directed and undirected graphs.
๐๏ธ Cyclic Sort Algorithm
Cyclic Sort is an efficient algorithm for solving problems involving numbers that are in a range from 1 to n or 0 to n. The key idea is to place each number at its correct index.
๐๏ธ DFS & BFS on Graphs
A comprehensive guide to implementing Depth-First Search (DFS) & BFS (Breadth-First Search) on graphs.
๐๏ธ Depth-First Search (DFS) for Trees
Depth-First Search (DFS) for Trees
๐๏ธ Dequeue (Double-Ended Queue) Implementation Cheatsheet
Basic Implementation
๐๏ธ Difference Array Technique
The difference array technique (also called prefix sum of differences) is an efficient method for handling multiple range updates on arrays.
๐๏ธ Dijkstra's Algorithm
Dijkstra's Algorithm
๐๏ธ Euclidean and Manhattan Distance
Euclidean Distance
๐๏ธ Divide and Conquer Technique
Overview
๐๏ธ Dutch National Flag Algorithm
Dutch National Flag Algorithm
๐๏ธ Dynamic Programming
Dynamic Programming (DP) is a technique used for solving complex problems by breaking them down into simpler overlapping subproblems. It involves storing the results of these subproblems to avoid redundant computations. There are two main approaches to implementing DP: Top-Down and Bottom-Up.
๐๏ธ Euclid's Algorithm for Greatest Common Divisor (GCD)
Euclid's Algorithm for Greatest Common Divisor (GCD)
๐๏ธ Euler Path, Hamilton Cycle, and Hierholzer's Algorithm
Table of Contents
๐๏ธ Fenwick Tree Tutorial
A comprehensive guide to Fenwick Trees with code examples in JavaScript.
๐๏ธ Fisher-Yates Shuffle Algorithm
The Fisher-Yates Shuffle algorithm is an efficient method for randomly shuffling a finite sequence of items. It ensures that each permutation of the sequence is equally likely.
๐๏ธ Flood Fill Algorithm
Flood Fill Algorithm
๐๏ธ Floyd-Warshall Algorithm
Floyd-Warshall algorithm is a classic algorithm for finding the shortest paths in a weighted graph with positive or negative edge weights (but no negative cycles). It can be used to find the shortest paths between all pairs of vertices in a graph.
๐๏ธ Floyd's Cycle Detection Algorithm
Normal Way of Detecting a cycle
๐๏ธ Frequency Counter Technique
Frequency Counter Technique
๐๏ธ Gaussian Elimination
Introduction
๐๏ธ Bipartite Graphs
A bipartite graph is a graph where the vertices can be divided into two sets such that no two vertices in the same set are adjacent.
๐๏ธ Heapโs Algorithm
Heapโs Algorithm is a classic algorithm used to generate all possible permutations of a finite sequence. It is particularly efficient for generating permutations and is widely used in combinatorial algorithms.
๐๏ธ Interval Problems
Interval Problems
๐๏ธ K-Way Merge Pattern
The k-way merge pattern is a technique used to merge k sorted arrays (or linked lists) into a single sorted array. It's commonly used in problems like merging multiple sorted arrays, finding the smallest range covering elements from k lists, and more.
๐๏ธ Kadane's Algorithm Tutorial
A comprehensive guide to Kadane's Algorithm with code examples in JavaScript.
๐๏ธ 0/1 Knapsack and Unbounded Knapsack
0/1 Knapsack Problems
๐๏ธ Kruskal's Algorithm
Kruskal's algorithm is a popular algorithm in graph theory for finding the Minimum Spanning Tree (MST) of a connected, weighted, undirected graph. The MST connects all vertices with the minimum total edge weight and without any cycles.
๐๏ธ LRU Cache Design
An LRU (Least Recently Used) Cache is a data structure that stores a limited number of items and automatically removes the least recently used item when the cache reaches its capacity. It's commonly used in scenarios where you need to manage memory by caching results of expensive operations.
๐๏ธ Line Sweep Algorithm
The Line Sweep algorithm is a computational geometry technique used to solve various problems involving intervals or segments. The basic idea is to "sweep" a line across the plane and process events as the line intersects with points of interest (typically the endpoints of segments).
๐๏ธ Linked List
Basic Structure
๐๏ธ Median of Two Sorted Arrays
Core Concepts
๐๏ธ Merge Sort
A comprehensive guide to understanding and implementing Merge Sort.
๐๏ธ Morris Traversal for Binary Trees
Morris Traversal
๐๏ธ Multiset in JavaScript
A Multiset (also known as a bag) is a data structure similar to a set, but it allows duplicate elements. In a multiset, each element can appear multiple times, and you can efficiently track the number of occurrences of each element.
๐๏ธ Multi-source BFS Algorithm
Multi-source BFS Algorithm
๐๏ธ N-ary Tree
An N-ary Tree is a tree data structure where each node can have up to N children. This is a generalization of a binary tree where each node can have more than two children. N-ary trees are useful in scenarios where a hierarchical structure is required, but nodes can have more than two children.
๐๏ธ Number of Islands Pattern
The Number of Islands problem is a classic grid-based problem that involves finding the number of distinct islands in a 2D grid. An island is formed by connected groups of 1s (land), and they are surrounded by 0s (water). The land cells can be connected either vertically or horizontally, but not diagonally.
๐๏ธ Parenthesis Pattern
Below is a list of common parenthesis-related problems.
๐๏ธ Path Sum (Binary Tree)
Path Sum (Binary Tree)
๐๏ธ Prefix Sum
A comprehensive guide to understanding and implementing Prefix Sum.
๐๏ธ Prim's Algorithm
Prim's algorithm is a greedy algorithm that finds a Minimum Spanning Tree (MST) for a connected, weighted, undirected graph. Unlike Kruskal's algorithm, which considers edges, Prim's algorithm grows the MST by adding vertices.
๐๏ธ Queue
A queue is a data structure that follows the First-In-First-Out (FIFO) principle. Elements are added at the rear and removed from the front. Queues are commonly used in scenarios where processing order needs to be maintained.
๐๏ธ Quick Select Algorithm
Quick Select Algorithm
๐๏ธ Quick Sort
A comprehensive guide to understanding and implementing Quick Sort.
๐๏ธ Recursion Patterns Cheatsheet
Core Concepts
๐๏ธ 10. Regular Expression Matching
https://leetcode.com/problems/regular-expression-matching/description/
๐๏ธ Reservoir Sampling
Reservoir Sampling is an algorithm used for randomly selecting a fixed number of items from a stream or a large dataset when the total number of items is not known in advance. It ensures that each item in the stream has an equal probability of being included in the sample.
๐๏ธ In-Place Reversal of a Linked List
In-Place Reversal of a Linked List
๐๏ธ Segment Tree Tutorial
A comprehensive guide to Segment Trees with code examples in JavaScript.
๐๏ธ Shortest Paths Problems
Problem: Shortest Path with Maximum Distance from Fire
๐๏ธ Sieve of Eratosthenes
The Sieve of Eratosthenes is an ancient algorithm used to find all prime numbers up to a given limit. It works by iteratively marking the multiples of each prime number starting from 2.
๐๏ธ Sliding Window Technique
Sliding Window Technique
๐๏ธ Fast and Slow Pointers Technique
The Fast and Slow Pointers technique, also known as the Tortoise and Hare algorithm, is a powerful method for solving problems involving linked lists and cyclic structures. It uses two pointers that move at different speeds to detect cycles, find the middle of a list, and solve other related problems efficiently.
๐๏ธ SortedList
An array-based implementation that maintains elements in sorted order.
๐๏ธ Stack
Introduction
๐๏ธ String Matching
Brute-Force String Matching
๐๏ธ Suffix Automaton
A Suffix Automaton is a state machine that represents all substrings of a given string efficiently. It's used primarily in string processing problems, such as substring matching, pattern matching, and finding repeated substrings, among others. It builds a minimal deterministic finite automaton (DFA) to recognize all the suffixes of a string.
๐๏ธ Topological Sort Tutorial
A comprehensive guide to Topological Sort with code examples in JavaScript.
๐๏ธ TreeMap
A self-balancing binary search tree implementation that stores key-value pairs in sorted order by keys.
๐๏ธ TreeSet
A self-balancing binary search tree implementation that stores unique values in sorted order.
๐๏ธ Trie Data Structure
Trie Data Structure
๐๏ธ Two Pointers Technique
The Two Pointers technique is a popular algorithmic approach used to solve problems involving arrays or lists. It involves using two pointers to traverse the data structure and solve problems efficiently.
๐๏ธ Union-Find (Disjoint Set Union) Tutorial
A comprehensive guide to Union-Find data structure with code examples in JavaScript.
๐๏ธ Unix File System
๐๏ธ Minimum Enclosing Circle - Welzl's Algorithm
Learn how to find the smallest enclosing circle for a set of points using Welzlโs Algorithm.