algorithmsdata_structures
A* search is an informed shortest-path algorithm that combines path cost so far with a heuristic estimate to the goal. It evaluates nodes using f(n) = g(n) + h(n), where g is the cost so far and h is ...
algorithms
Algorithms are step-by-step procedures or formulas for solving problems. They are fundamental to computer science and are used to perform tasks ranging from simple calculations to complex data process...
data_structuresalgorithms
All-Pairs Shortest Path (APSP) finds the minimum distance between every pair of vertices in a graph. Common solutions include Floyd-Warshall for dense graphs and negative edge support, repeated Dijkst...
algorithmsdata_structures
Bellman-Ford finds single-source shortest paths in weighted directed graphs, including those with negative edge weights. It reliably detects reachable negative cycles, which makes it more general than...
data_structuresalgorithms
Big O notation describes how the running time or space usage of an algorithm grows with input size. It focuses on dominant terms and ignores constant factors, providing a language to compare and reaso...
algorithmsdata_structures
Boruvka's algorithm builds a minimum spanning tree by repeatedly connecting each component to its cheapest outgoing edge. It starts with every vertex as its own component and merges components in roun...
data_structuresalgorithms
Breadth-first search (BFS) is a method of exploring a graph outward layer-by-layer from a starting point. Its core purpose is to measure distance in terms of edge-steps, making it ideal for finding th...
data_structuresalgorithms
Collision resolution refers to techniques for handling cases where two or more keys map to the same bucket or index in a hash table. Common strategies include separate chaining and open addressing (e....
data_structuresalgorithms
Cuckoo hashing is a collision-resolution strategy for hash tables that uses two (or more) hash functions. Each key has multiple possible locations; if an insertion finds a spot occupied, it "kicks out...
algorithms
Dijkstra's algorithm finds the shortest paths from a single source to all other nodes in a weighted graph with non-negative edge weights. It uses a greedy strategy with a priority queue to always expa...
algorithmsapis_&_frameworks
A directed acyclic graph (DAG) is a directed graph with no cycles, which makes it perfect for modeling dependencies that must flow forward. DAGs guarantee at least one topological ordering of nodes th...
data_structuresalgorithms
A directed graph (digraph) is a set of nodes connected by edges that have direction. It models one-way relationships like links from page A to page B or task A must happen before task B. Direction cha...
data_structuresalgorithms
Disjoint Set Union (DSU), also called Union-Find, maintains a partition of elements into disjoint sets while supporting fast queries to check if two elements share a set and to merge sets. It uses a p...
data_structuresalgorithms
Edmonds-Chu-Liu finds a minimum-cost arborescence: a directed, rooted spanning tree that minimizes total edge weight. It works by selecting one minimum incoming edge per node, contracting any cycles, ...
data_structuresalgorithms
An adjacency list represents a graph by storing, for each vertex, a list of its neighboring vertices. It is the go-to structure for sparse graphs because it uses space proportional to V + E. Edge inse...
data_structuresalgorithms
An adjacency matrix is a square n×n matrix that represents a graph with n vertices. Entry A[i][j] indicates whether an edge exists from i to j, or stores the edge weight in weighted graphs. It offers ...
algorithmsdata_structuresbasics_of_computer_science
Graph cost captures how we measure and optimize over weighted graphs, usually by minimizing or maximizing sums of edge weights. Core problems include building minimum spanning trees, finding shortest ...
data_structuresalgorithms
Depth-first search (DFS) is a fundamental graph traversal that explores as far as possible along each branch before backtracking. It can be implemented with recursion or an explicit stack, and it work...
algorithmsdata_structuresbasics_of_computer_sciencepython
A greedy algorithm builds a solution step by step by always taking the locally best option available. It is fast and simple, often relying on sorting or priority queues to repeatedly pick the next bes...
data_structuresalgorithms
Hash functions map data of arbitrary size to fixed-size values (hashes) quickly and deterministically. Good hashes distribute inputs uniformly, minimize collisions, and are efficient. They underpin da...
data_structuresalgorithms
Open addressing is a collision resolution strategy for hash tables that stores all entries inside the table array. When a collision happens, the algorithm probes alternative indices until it finds an ...
algorithms
A Hidden Markov Model (HMM) is a probabilistic model for sequences where the underlying states are hidden but generate observable outputs. It assumes a first order Markov process over hidden states an...
algorithmsdata_structures
Algorithms are step-by-step methods for solving problems efficiently and correctly. This overview covers what algorithms are, how to reason about correctness, and how to measure time and space with Bi...
data_structuresalgorithmsbasics_of_computer_sciencememorysoftware_engineering
Data structures are ways to organize data so operations like access, insert, delete, and search are efficient. The right structure can turn a slow program into a fast one by shaping how data is stored...
data_structuresalgorithms
A weighted graph is a graph where each edge carries a numeric value called a weight, often representing cost, distance, time, or capacity. Weights change how you evaluate paths and structures, directl...
data_structuresalgorithms
Kruskal is a greedy algorithm for building a minimum spanning tree of a weighted, undirected graph. It sorts edges by weight and adds the next lightest edge that does not form a cycle, using a union-f...
data_structuresalgorithms
A Markov chain tracks how likely a system is to move from one state to another. The transition data can be stored either as an adjacency list (per-state neighbors and weights) or as an adjacency/trans...
algorithmsdata_structures
A maximum spanning tree (Max-ST) connects all vertices of a weighted, undirected graph with the highest possible total edge weight while avoiding cycles. It is the mirror concept of the minimum spanni...
algorithms
Merge sort is a classic divide-and-conquer sorting algorithm that splits a list into halves, recursively sorts each half, and then merges the sorted halves into a fully ordered list. It runs in O(n lo...
data_structuresalgorithms
A minimum spanning tree (MST) connects all vertices in a weighted, undirected, connected graph with the minimum total edge weight and no cycles. It is a foundational concept for network design, cluste...
algorithmsbasics_of_computer_science
PageRank is a link analysis algorithm that assigns importance scores to nodes in a directed graph using the random surfer model. It models a Markov chain where a surfer follows links with probability ...
algorithms
Perfect hashing is a technique for constructing a hash function that maps a fixed, known set of keys to distinct table indices with zero collisions. It provides worst-case O(1) lookup and is especiall...
data_structuresalgorithms
Prim's algorithm is a greedy method to build a minimum spanning tree of a connected, weighted, undirected graph. It starts from any vertex and repeatedly adds the smallest edge that connects the growi...
algorithmsbasics_of_computer_science
Pseudocode is a language-agnostic way to describe algorithms and program logic using plain, structured steps. It removes syntax details so you can focus on thinking clearly about the procedure. Teams ...
data_structuresalgorithmsbasics_of_computer_science
Shortest path problems ask for the minimum-cost route between nodes in a graph. Cost can mean hops, time, distance, or any additive weight on edges. Different constraints call for different algorithms...
data_structuresalgorithms
Single-pair shortest path finds the minimum-cost route between one source node and one target node in a graph. It differs from single-source and all-pairs problems by optimizing effort for just one pa...
data_structuresalgorithms
Single-source shortest path (SSSP) finds the minimum-cost path from one start node to every other node in a weighted graph. The right algorithm depends on edge weights and graph structure: BFS for unw...
data_structuresalgorithms
A tree is a hierarchical data structure where nodes are connected by edges with exactly one path from the root to any node. It models parent-child relationships and is a special case of a graph that i...
data_structuresalgorithms
A trie is a prefix tree for strings that stores characters along paths, sharing common prefixes across keys. It offers O(L) insert, search, and prefix queries where L is the key length, largely indepe...
data_structuresalgorithms
An undirected graph models relationships where connections have no direction, like mutual friendships or two-way roads. It consists of vertices (nodes) and edges that connect pairs of vertices. Key id...