Numerical Problems & Algorithms
Solving Linear Equations
Bandwidth Reduction
C++ Program to Implement RCM Algorithm
C++ Program to Optimize Wire Length in Electrical Circuit
C++ Program to Perform Matrix Multiplication
C++ Program to Implement Strassen’s Algorithm
C++ Program to Perform Optimal Paranthesization Using Dynamic Programming
C++ Program to Find Path Between Two Nodes in a Graph
C++ Program to Check if it is a Sparse Matrix
C++ Program to Find Basis and Dimension of a Matrix
C++ Program to Perform Complex Number Multiplication
C++ Program to Check Multiplicability of Two Matrices
Determinants and Permanents
C++ Program to Check if a Matrix is Invertible
C++ Program to Compute Determinant of a Matrix
Constrainted and UnConstrained Optimization
C++ Program to Find Minimum Value of any Algebraic Expression
C++ Program to Find Maximum Value of any Algebraic Expression
C++ Program to Implement Steepest Descent Method and Compute Local Optima
C++ Program to Implement Conjugate Method and Compute Local Optima
C++ Program to Implement Modular Exponentiation Algorithm
Linear Programming
C++ Program to Find Maximum Value of an Expression and Given 3 Inequalities
C++ Program to Optimize Solution for Employer Applicant Mark Problem Using Linear Programming
Random Number Generation
C++ Program to Generate N Number of Passwords of Length M Each
C++ Program to Generate Date Between Given Range
C++ Program to Generate Randomized Sequence of Given Range of Numbers
C++ Program to Generate Random Hexadecimal Bytes
C++ Program to Generate Tetris Game Using Random Number Generation
C++ Program to Create a Random Bitmap Image
C++ Program to Emulate N Dice Roller
C++ Program to Use rand and srand Functions
C++ Program to Implement the linear congruential generator for Pseudo Random Number Generation
C++ Program to Generate Random Numbers Using Middle Square Method
C++ Program to Generate Random Numbers Using Multiply with Carry Method
C++ Program to Generate Random Numbers Using Probability Distribution Function
C++ Program to Implement Inversion Method for Random Number Generation
C++ Program to Perform Random Number Generation Using Inversion Method
C++ Program to Implement Fisher-Yates Algorithm for Array Shuffling
C++ Program to Implement Park-Miller Random Number Generation Algorithm
C++ Program to Implement Naor-Reingold Pseudo Random Function
Factoring and Primality Testing
C++ Program to Implement wheel Sieve to Generate Prime Numbers Between Given Range
C++ Program to Implement Sieve of eratosthenes to Generate Prime Numbers Between Given Range
C++ Program to Implement Sieve of Atkin to Generate Prime Numbers Between Given Range
C++ Program to Implement Segmented Sieve to Generate Prime Numbers Between Given Range
C++ Program to Implement the Rabin-Miller Primality Test to Check if a Given Number is Prime
C++ Program to Implement the Solovay-Strassen Primality Test to Check if a Given Number is Prime
C++ Program to Find the GCD and LCM of n Numbers
C++ Program to Perform the Unique Factorization of a Given Number
C++ Program to Find GCD of Two Numbers Using Recursive Euclid Algorithm
C++ Program to Generate Prime Numbers Between a Given Range Using the Sieve of Sundaram
C++ Program to Perform Baillie-PSW Primality Test
C++ Program to Implement Fermat Primality Test
Arbitrary-Precision Arithmetic
C++ Program to Perform Addition Operation Using Bitwise Operators
C++ Program to Implement Booth’s Multiplication Algorithm for Multiplication of 2 signed Numbers
C++ Program to Implement the Schonhage-Strassen Algorithm for Multiplication of Two Numbers
C++ Program to Perform Arithmetic Operations on Numbers of Size Greater than that of Int Without Using any Data Type of Size Greater than Int
C++ Program to Implement Russian Peasant Multiplication
C++ Program to Implement Euler Theorem
C++ Program to Implement Extended Eucledian Algorithm
C++ Program to Implement Fermat’s Little Theorem
Knapsack Problem
C++ Program to Solve the 0-1 Knapsack Problem
C++ Program to Solve the Fractional Knapsack Problem
C++ Program to Perform Partition of an Integer in All Possible Ways
C++ Program to Fill Given n Numbers into a Given N Number and Ensure that Minimum is Left from N
C++ Program to Implement the Bin Packing Algorithm
C++ Program to Solve Knapsack Problem Using Dynamic Programming
C++ Program to Calculate Maximum Payoff by ReOrdering Two Given Sets
Discrete Fourier Transform
C++ Program to Compute DFT Coefficients Directly
C++ Program to Compute Discrete Fourier Transform Using Naive Approach
C++ Program to Compute Discrete Fourier Transform Using the Fast Fourier Transform Approach
C++ Perform to a 2D FFT Inplace Given a Complex 2D Array
Factorials and Fibonacci Numbers
C++ Program to Find Factorial of a Number using Recursion
C++ Program to Find Factoial of a Number using Iteration
C++ Program to Find Factoial of a Number using Dynamic Programming
C++ Program to Find Factoial of Large Numbers
C++ Program to Find Fibonacci Numbers using Recursion
C++ Program to Find Fibonacci Numbers using Iteration
C++ Program to Find Fibonacci Numbers using Dynamic Programming
C++ Program to Find Fibonacci Numbers using Matrix Exponentiation
Combinatorial Problems & Algorithms
Sorting
C++ Program to Implement Radix Sort
C++ Program to Implement Bucket Sort
C++ Program to Implement Bubble Sort
C++ Program to Implement Heap Sort
C++ Program to Implement Merge Sort
C++ Program to Implement Selection Sort
C++ Program to Implement Insertion Sort
C++ Program to Implement Quick Sort Using Randomization
C++ Program to Implement Shell Sort
C++ Program to Implement Sorting of Less than 100 Numbers in O(n) Complexity
C++ Program to Perform Sorting Using B-Tree
C++ Program to Perform Quick Sort on Large Number of Elements
C++ Program to Implement Merge Sort using Linked List
C++ Program to Implement Counting Sort
C++ Program to Perform the Shaker Sort
C++ Program to Perform Stooge Sort
C++ Program to Count Inversion in an Array
Searching
C++ Program to Compare Binary and Sequential Search
C++ Program to Perform Searching Using Self-Organizing Lists
C++ Program to Implement a Binary Search Algorithm for a Specific Search Sequence
C++ Program to Search for an Element in a Binary Search Tree
C++ Program to Implement Multi-Threaded Version of Binary Search Tree
C++ Program to Perform Searching Based on Locality of Reference
C++ Program to Implement Interpolation Search Algorithm
C++ Program to Find kth Largest Element in a Sequence
C++ Program to Search Sorted Sequence Using Divide and Conquer with the Aid of Fibonacci Numbers
C++ Program to Perform Uniform Binary Search
C++ Program to Find Minimum Element in an Array using Linear Search
C++ Program to Find Maximum Element in an Array using Binary Search
C++ Program to Find the Minimum element of an Array using Binary Search approach
C++ Program to Find the peak element of an array using Binary Search approach
Median and Selection
C++ Program to Find Second Smallest of n Elements with Given Complexity Constraint
C++ Program to Implement Quick Sort with Given Complexity Constraint
C++ Program to List the kth Quantiles of a Set within Given Time Constraint
C++ Program to Find k Numbers Closest to Median of S, Where S is a Set of n Numbers
C++ Program to Find Median of Two Sorted Arrays
C++ Program to Find ith Largest Number from a Given List Using Order-Statistic Algorithm
C++ Program to Find kth Smallest Element by the Method of Partitioning the Array
C++ Program to Find the Mode in a Data Set
C++ Program to Find the Number of occurrences of a given Number using Binary Search approach
C++ Program to Find the Median of two Sorted Arrays using Binary Search Approach
C++ Program to Find the maximum subarray sum O(n^2) time(naive method)
C++ Program to Find the maximum subarray sub using Divide and Conquer Approach
Generating Permutations and Combinations
C++ Program to Implement the Alexander Bogomolny’s UnOrdered Permutation Algorithm for Elements From 1 to N
C++ Program to Permute All Letters of an Input String
C++ Program to Implement Heap’s Algorithm for Permutation of N Numbers
C++ Program to Generate All Possible Combinations of a Given List of Numbers
C++ Program to Generate a Sequence of N Characters for a Given Specific Case
C++ Program to Compute Combinations using Factorials
C++ Program to Compute Combinations using Recurrence Relation for nCr
C++ Program to Compute Combinations using Matrix Multiplication
C++ Program to Find the Number of Permutations of a Given String
Generating Subsets
C++ Program to Generate All Subsets of a Given Set in the Gray Code Order
C++ Program to Generate All Subsets of a Given Set in the Lexico Graphic Order
C++ Program to Implement the Binary Counting Method to Generate Subsets of a Set
C++ Program to Generate a Random Subset by Coin Flipping
C++ Program to Generate All Possible Subsets with Exactly k Elements in Each Subset
C++ Program to Generate All Possible Combinations Out of a,b,c,d,e
C++ Program to Generate All Pairs of Subsets Whose Union Make the Set
C++ Program to Generate All Sequences out of a Binary Sequence without Altering 0 Positions while Changing 1
Generating Partitions
C++ Program to Perform Integer Partition for a Specific Case
C++ Program to Generate All the Set Partitions of n Numbers Beginning from 1 and so on
C++ Program to Generate Random Partition out of a Given Set of Numbers or Characters
C++ Program to Find the Number of Ways to Write a Number as the Sum of Numbers Smaller than Itself
C++ Program to Solve Palindrome Partitioning Problem
Generating Graphs
C++ Program to Generate a Random UnDirected Graph for a Given Number of Edges
C++ Program to Generate a Random Directed Acyclic Graph DAC for a Given Number of Edges
C++ Program to Create a Random Graph Using Random Edge Generation
C++ Program to Construct a Random Graph by the Method of Random Edge Selection
C++ Program to Construct a Random Graph by the Method of Preferencial Attachment
C++ Program to Create the Prufer Code for a Tree
C++ Program to Generate a Graph for a Given Fixed Degree Sequence
C++ Program to Generate a Semi-Random Collection of Graphs by Using the Technique of Edge-Flipping
C++ Program to Check if any Graph is Possible to be Constructed for a Given Degree Sequence
C++ Program to Describe the Representation of Graph using Adjacency Matrix
C++ Program to Represent Graph Using Incidence Matrix
C++ Program to Describe the Representation of Graph using Adjacency List
C++ Program to Describe the Representation of Graph using Incidence List
C++ Program to Represent Graph Using 2D Arrays
C++ Program to Represent Graph Using Linked List
Other
C++ program to Solve Tower of Hanoi Problem using Binary Value
Graph Problems & Algorithms
Connected Components
C++ Program to Solve any Linear Equation in One Variable
C++ Program to Check whether Undirected Graph is Connected using BFS
C++ Program to Check the Connectivity of Directed Graph Using BFS
C++ Program to Check whether Undirected Graph is Connected using DFS
C++ Program to Check whether Directed Graph is Connected using DFS
C++ Program to Test Using DFS Whether a Directed Graph is Weakly Connected or Not
C++ Program to Check Whether a Graph is Strongly Connected or Not
C++ Program to Check if an Undirected Graph is a Tree or Not Using DFS
C++ Program to Check if an Directed Graph is a Tree or Not Using DFS
C++ Program to Find the Connected Components of an UnDirected Graph
C++ program to find if a given undirected graph is biconnected
C++ Program to Create a Minimal Set of All Edges Whose Addition will Convert it to a Strongly Connected DAG
C++ Program to Find Strongly Connected Components in Graphs
Topological Sorting
C++ Program to Apply DFS to Perform the Topological Sorting of a Directed Acyclic Graph
C++ Program to Check Whether Topological Sorting can be Performed in a Graph
C++ Program to Create a Random Linear Extension for a DAG
C++ Program to Generate All the Possible Linear Extensions of a DAG
C++ Program to Remove the Edges in a Given Cyclic Graph such that its Linear Extension can be Found
C++ Program to Check Cycle in a Graph using Topological Sort
C++ Program for Topological Sorting in Graphs
Minimum Spanning Tree
C++ Program to Apply the Prim’s Algorithm to Find the Minimum Spanning Tree of a Graph
C++ Program to Apply the Kruskal’s Algorithm to Find the Minimum Spanning Tree of a Graph
C++ Program to Use Boruvka’s Algorithm to Find the Minimum Spanning Tree
C++ Program to Create a MST of a Set of Points Spread in Two Dimensions Using Delaunay Triangulation
C++ Program to Give an Efficient Algorithm to Compute the Second-Best Minimum Spanning Tree of G
C++ Program to Find MST(Minimum Spanning Tree) using Kruskal’s Algorithm
C++ Program to Find MST(Minimum Spanning Tree) using Prim’s Algorithm
Shortest Path
C++ Program to Find the Shortest Path Between Two Vertices Using Dijkstra’s Algorithm
C++ Program to Find the Shortest Path from Source Vertex to All Other Vertices in Linear Time
C++ Program to Use the Bellman-Ford Algorithm to Find the Shortest Path Between Two Vertices Assuming that Negative Size Edges Exist in the Graph
C++ Program to Implement Shortest Path Algorithm for DAG Using Topological Sorting
C++ Program to Find Shortest Path Between All Vertices Using Floyd-Warshall’s Algorithm
C++ Program to Find the Shortest Cycle in a Graph
C++ Program to Implement Dijkstra’s Algorithm Using Queue
C++ Program to Implement Dijkstra’s Algorithm using Priority_queue(Heap)
C++ Program to Implement Dijkstra’s Algorithm Using Set
C++ Program to Implement Bellmanford Algorithm
C++ Program to Implement Floyd-Warshall Algorithm
C++ Program to Implement Johnson’s Algorithm
C++ Program to Find SSSP(Single Source Shortest Path) in DAG(Directed Acyclic Graphs)
Transitive Closure and Reduction
C++ Program to Find the Transitive Closure of a Given Graph G
C++ Program to Construct Transitive Closure Using Warshall’s Algorithm
C++ Program to Find Transitive Closure of a Graph
Matching
C++ Program to Solve a Matching Problem for a Given Specific Case
C++ Program to Rearrange Letters of a String such that no More than 1 Letters should Retain the Same Position
C++ Program to Solve a Matching Problem for a Given Specific Case
C++ Program to Implement the Hungarian Algorithm for Bipartite Matching
C++ Program to Implement the Edmond’s Algorithm for Maximum Cardinality Matching
C++ Program to Solve a Matching Problem for a Given Specific Case
Eulerian Cycle/Chinese Postman
C++ Program to Check Whether an Undirected Graph Contains a Eulerian Cycle
C++ Program to Check Whether an Undirected Graph Contains a Eulerian Path
C++ Program to Check Whether a Directed Graph Contains a Eulerian Cycle
C++ Program to Check Whether a Directed Graph Contains a Eulerian Path
C++ Program to Give an Implementation of the Traditional Chinese Postman Problem
C++ Program to Implement Euler Circuit Problem
Edge and Vertex Connectivity
C++ Program to Check Whether it is Weakly Connected or Strongly Connected for a Directed Graph
C++ Program to Check whether Graph is Biconnected
C++ Program to Implement Max-Flow and Min-Cut Theorem
C++ Program to Find the Edge Connectivity of a Graph
C++ Program to Find the Vertex Connectivity of a Graph
C++ Program to Check whether Graph is a Bipartite using 2 Color Algorithm
C++ Program to Check whether Graph is a Bipartite using BFS
C++ Program to Check whether Graph is a Bipartite using DFS
C++ Program to Find Maximum Number of Edge Disjoint Paths
C++ Program to Find Number of Articulation points in a Graph
Drawing Trees
C++ Program to Perform Dictionary Operations in a Binary Search Tree
C++ Program to Create a Balanced Binary Tree of the Incoming Data
C++ Program to Implement Binary Search Tree
C++ Program to Construct an Expression Tree for a Given Prefix Expression
C++ Program to Construct an Expression Tree for a Postfix Expression
C++ Program to Construct an Expression Tree for an Infix Expression
C++ Program to Perform Preorder Non-Recursive Traversal of a Given Binary Tree
C++ Program to Perform Postorder Non-Recursive Traversal of a Given Binary Tree
C++ Program to Perform Inorder Non-Recursive Traversal of a Given Binary Tree
C++ Program to Perform Preorder Recursive Traversal of a Given Binary Tree
C++ Program to Perform Inorder Recursive Traversal of a Given Binary Tree
C++ Program to Perform Postorder Recursive Traversal of a Given Binary Tree
C++ Program to Sort an Array of 10 Elements Using Heap Sort Algorithm
C++ Program to Implement Double Order Traversal of a Binary Tree
C++ Program to Perform Left Rotation on a Binary Search Tree
C++ Program to Perform Right Rotation on a Binary Search Tree
C++ Program to Print the Kind of Rotation the AVL Tree is Undergoing When you Add an Element or Delete an Element
C++ Program to Print only Odd Numbered Levels of a Tree
C++ Program to Find Deepest Left Leaf in a Binary Tree
C++ Program to Remove All nodes which don’t lie in any Path with Sum >= K
C++ Program to Check if a Given Binary Tree is an AVL Tree or Not
C++ Non-recursive program to delete an entire binary tree
C++ Program to Find Whether a Path Exists Between 2 Given Nodes
C++ Program to Check Whether an Input Binary Tree is the Sub Tree of the Binary Tree
C++ Program to Check if a Binary Tree is a BST
C++ Program to Implement Sorted Linked List to Balanced BST
C++ Program to Implement Segment Tree
C++ Program to Implement B-Tree
C++ Program to Implement Interval Tree
C++ Program to Implement Range Tree
C++ Program to Implement Ternary Seach Tree
C++ Program to Implement AA Trees
C++ Program to Implement AVL Trees
C++ Program to Implement Cartesian Tree
C++ Program to Implement Splay Tree
C++ Program to Implement T Tree
C++ Program to Implement Tango Tree
C++ Program to Implement Threaded Binary Tree
C++ Program to Implement Top Tree
C++ Program to Implement Weight Balanced Tree
C++ Program to Implement Trie
C++ Program to Implement Suffix Tree
C++ Program to Implement Red Black Tree
C++ Program to Implement Randomized Binary Search Tree
C++ Program to Implement ScapeGoat Tree
C++ Program to Implement Self Balancing Binary Search Tree
C++ Program to Find Lowest Common Ancestor in a Binary Search Tree
C++ Program To Check Whether a Given Tree is Binary Search Tree
C++ Program to Implement Ternary Tree
C++ Program to Implement Range Tree
C++ Program to Implement Interval Tree
C++ Program to Implement Segment Tree
C++ Program to Implement Fusion Tree
C++ Program to Implement B+ Tree
C++ Program For Inorder Tree Traversal without Recursion
C++ Program to Implement B-Tree
C++ Program to Find the Minimum value of Binary Search Tree
C++ Program to Implement a Binary Search Tree using Linked Lists
C++ Program to Implement Expression Tree Algorithm
Planarity Detection and Embedding
C++ Program to Check Whether a Graph is Planar or Not
C++ Program to Implement the Hopcroft and Tarjan Algorithm
C++ Program to Implement the Booth and Lueker Algorithm to Check for Planarity
Graph Search
C++ Program to Implement Beam Search Algorithm
C++ Program to Implement Best First Search
C++ Program to Implement Bidirectional Search
C++ Program to Implement all Forward Edges in a Graph
C++ Program to Implement Find all Cross Edges in a Graph
C++ Program to Find all Back Edges in a Graph
Depth First Search (DFS) Implementation using C++
C++ Program to Implement Iterative Deepening
C++ Program to Implement Uniform-Cost Search
Other
C++ Program to Find Inverse of a Graph Matrix
C++ Program to Find Transpose of a Graph Matrix
C++ Program to Implement Network_Flow Problem
Network Flow
C++ Program to Implement The Edmonds-Karp Algorithm
C++ Program to Implement Ford–Fulkerson Algorithm
Graph Traversal
C++ Program to Traverse a Graph using BFS
C++ Program to Traverse a Graph using DFS
Hard Graph Problems & Algorithms
Clique
C++ Program to Find the Maximum Size Clique in a Graph
C++ Program to Find a Clique by Using the Technique of the Most Dense Subgraph
C++ Program to Find the Largest clique in a Planar Graph
C++ Program to Solve the Decision Problem of Testing Whether a Graph Contains a Clique Larger than a Given Size
C++ Program to Find a Maximum Weight Clique in a Weighted Graph
C++ Program to Find All the Cliques of a Given Size k
C++ Program to Find the Largest Independent Set in a Graph by Comravplements and Find the Clique of this Graph
C++ Program to Find Independent Sets in a Graph by Graph Coloring
C++ Program to Find the Maximum Independent Set of a Tree in Linear Time
C++ Program to Find Size of the Largest Independent Set(LIS) in a Given a Binary Tree
C++ Program to Find Size of the Largest Independent Set(LIS) in a Given an N-ary Tree
Vertex Cover
C++ Program to Implement a Heuristic to Find the Vertex Cover of a Graph
C++ Program to Solve the Dominating Set Problem
C++ Program to Check Whether a Vertex Cover of Size k Exists
Traveling Salesman Problem
C++ Program to Solve Travelling Salesman Problem for Unweighted Graph
C++ Program to Implement Branch and Bound Method to Perform a Combinatorial Search
C++ Program to Solve TSP Using Minimum Spanning Trees
C++ Program to Solve TSP Using Incremental Insertion Method
C++ Program to Find a k-Optimal Tour for TSP
C++ Program to Implement Held-Karp Algorithm
C++ Program to Implement Nearest Neighbour Algorithm
C++ Program to Implement Traveling Salesman Problem using Nearest neighbour Algorithm
Hamiltonian Cycle
C++ Program to Find Hamiltonian Cycle
C++ Program to Find the Longest Path in a DAG
C++ Program to Check if a Given Graph must Contain Hamiltonian Cycle or Not
C++ Program to Convert Hamiltonian Cycle into Path
C++ Program to Check Whether a Hamiltonian Cycle or Path Exists in a Given Graph
Graph Partition
C++ Program to Find Minimum Number of Edges to Cut to make the Graph Disconnected
C++ Program to Partition a Tree from a Given Element using DFS
C++ Program to Find the Maximum Cut in a Graph
C++ Program to Perform Spectral Partitioning of a Graph
Vertex Coloring
C++ Program to Perform Graph Coloring on Bipartite Graphs
C++ Program to Check if a Given Graph is Bipartite
C++ Program to Perform Edge Coloring of a Graph
C++ Program to Use Color Interchange Method to Perform Vertex Coloring of Graph
C++ Program to Demonstrate the Implementation of 4-Color Problem
C++ Program to Perform Greedy Coloring
Edge Coloring
C++ Program to Implement the Vizing’s Theorem
C++ Program to Find Chromatic Index of Cyclic Graphs
C++ Program to Perform Edge Coloring on Complete Graph
C++ Program to Perform Edge Coloring to the Line Graph of an Input Graph
C++ Program to Find the Arboricity of a Graph
C++ Program to Solve the Open Shop Scheduling Problem
Steiner Tree
C++ Program to Find the Steiner Tree of a Given Graph
C++ Program to Apply Heuristic Based on Shortest Path to Find Steiner Tree
C++ Program to Check if a Steiner Tree Size k Exists for a Graph
Feedback Edge/Vertex Set
C++ Program to Check Whether Graph is DAG
C++ Program to Find a Good Feedback Edge Set in a Graph
C++ Program to Find a Good Feedback Vertex Set
Computational Geometry Problems & Algorithms
Robust Geometric Primitives
C++ Program to Apply Above-Below-on Test to Find the Position of a Point with respect to a Line
C++ Program to Compute the Area of a Triangle Using Determinants
C++ Program to Compute the Volume of a Tetrahedron Using Determinants
C++ Program to Find the Area of any Polygon Using Triangulation
C++ Program to Implement Slicker Algorithm that avoids Triangulation to Find Area of a Polygon
C++ Program to Use Above Below Primitive to Test Whether Two Lines Intersect
C++ Program to Check if a Point d lies Inside or Outside a Circle Defined by Points a, b, c in a Plane
C++ Program to Apply Delaunay Triangulation Algorithm
C++ Program to Solve the Directed Segment Problem
C++ Program to Solve the Directed Segment Problem
C++ Program to Compute Cross Product of Two Vectors
Convex Hull
C++ Program to Implement Graham Scan Algorithm to Find the Convex Hull
C++ Program to Implement Gift Wrapping Algorithm in Two Dimensions
C++ Program to Implement Jarvis March to Find the Convex Hull
C++ Program to Implement Quick Hull Algorithm to Find Convex Hull
C++ Program to Implement Chan’s Algorithm
C++ Program to Implement Incremental Method to Find the Convex Hull
C++ Program to Implement Divide and Conquer Method to Find the Convex Hull
C++ Program to Implement Prune and Search Method to Find the Convex Hull
Triangulation
C++ Program to Triangulate by Adding to the Convex-Hull Diagonals from the First Point to All of the Others
C++ Program to Implement Delaunay Triangulation to Perform Triangulation
C++ Program to Implement “Triangle” by Jonathan Shewchuk
C++ Program to Implement Fortune’s Sweep2 Code
C++ Program to Implement Flip Algorithm for Non-Delaunay Triangles
C++ Program to Use SweepHull for Fast Delaunay Triangulation
Voronoi Diagrams
C++ Program to Implement Voronoi Diagram Using Fortune’s Algorithm
C++ Program to Implement Voronoi Diagram Using Divide and Conquer Algorithm
C++ Program to Implement Lloyd’s Algorithm
C++ Program to Implement Voronoi Diagram Problem Using Graphs
C++ Program to Implement Bowyer-Watson Algorithm
Nearest Neighbor Search
C++ Program to Find the Nearest Neighbour Using K-D Tree Search
C++ Program to Find Nearest Neighbour Using Voronoi Diagram
C++ Program to Find Nearest Neighbour for Static Data Set
C++ Program to Find Nearest Neighbour for Dynamic Data Set
C++ Program to Find Nearest Neighbour Using Linear Search
Range Search
C++ Program to Construct K-D Tree for 2 Dimensional Data (assume static data)
C++ Program to Perform Insertion in a 2 Dimension K-D Tree
C++ Program to Perform Searching in a 2-Dimension K-D Tree
C++ Program to Find the Node with Minimum Value (with respect to that cutting Dimension) for a Given Node, and a Cutting Dimension
C++ Program to Perform Deletion in K-D Tree
C++ Program to Perform 3-Dimensional Range Query
C++ Program to Perform 1-Dimensional Range Query
C++ Program to Perform Range Query in 2-Dimension
C++ Program to Perform Dynamic Range Searching where Data is Dynamically Inserted or Deleted
C++ Program to Perform Partial Key Search in a K-D Tree
Point Location
C++ Program to Check Whether a Given Point is in a Given Polygon
C++ Program to Find Location of a Point by Triangulation of the Given Polygon
C++ Program to Find Location of a Point by Constructing K*K Grid on a Given Polygon
C++ Program to Find Location of a Point Placed in Three Dimensions Using K-D Trees
C++ Program to Find the Point Location Using Slab Method
C++ Program to Find Location of a Point by Trapezoidal Decomposition
Intersection Detection
C++ Program to Perform Sphere Sphere Intersection Testing
C++ Program to Perform Interval-Interval Intersection Testing
C++ Program to Perform AABB-AABB Intersection Testing
C++ Program to Perform Sphere-AABB Intersection Testing
C++ Program to Perform Ray-Sphere Intersection Testing
C++ Program to Find Ray-Polygon Intersection Point
C++ Program to Perform Polygon Containment Test
C++ Program to Perform Brute Force Collision Detection
C++ Program to Check Visibility of a Point X to Y
C++ Program to Implement Plane Sweep Algorithms for Intersection of Lines
Bin Packing
C++ Program to Implement First Fit Decreasing for 1-D Objects and M Bins
C++ Program to Implement First Fit Decreasing for 1-D Objects Using Binary Tree
C++ Program to Find the Minimum Area of a Rectangle to Fit N Rectangles of Different Sizes
C++ Program to Find Largest Rectangular Area in a Histogram
Polygon Partitioning
C++ Program to Implement Hertel-Mehlhorn Heuristic for Convex Decomposition Using Diagonals
C++ Program to Delete All Lines from a Polygon such that it becomes a Convex Polygon
C++ Program to Perform Triangulation to Partition the Polygon in Triangles
C++ Program to Perform Optimal Convex Partitioning Using Dynamic Programming
Simplifying Polygons
C++ Program for Douglas-Peucker Algorithm Implementation
C++ Program to Implement Chazelle’s Linear time Triangulation Algorithm
Shape Similarity
C++ Program to Perform Housdorff based Image Comparison
Motion Planning
C++ Program to Construct a Visibility Graph of the Polygonal Obstacles
C++ Program to Find a Set of Legal Configuration Space Points by Randon Sampling
Maintaining Line Arrangements
C++ Program to Perform Degeneracy Testing on a Set of n Lines
C++ Program to Perform Insertion in a Line Arrangement
C++ Program to Construct a Full Arrangement of n Lines
C++ Program to Perform Intersection Detection of Line Arrangement
C++ Program to Find a Point P that Satisfies Maximum Number of such Constraints for a Given Set of Constraints of type yC++ Program to Show the Duality Transformation of Line and Point
C++ Program to Check Whether a Given Points are Colinear or Not
C++ Program to Implement Sweepline Algorithm
C++ Program to Solve N-Queen Problem
Set & String
Set Cover
C++ Program to Find the Smallest Set of Vertices that will Cover Each Edge atleast once.
C++ Program to Find an Optimal Solution for Set Cover Problem Using Backtracking
C++ Program to Use Integer Programming Formula to Solve the Set Cover Problem
C++ Program to Solve Set Cover Problem assuming at max 2 Elements in a Subset
C++ Program to Implement Boolean Logic Minimization Using Set Cover Problem
C++ Program to Use Greedy Approach to Solve Set Cover Problem
Set Packing
C++ Program to Implement Exhaustive Search Algorithm for Set Packing
C++ Program to Implement Heuristic Approach to Solve Set Packing
C++ Program to Check if a Set Packing is Possible of Size k for a Given Pair of Universe U and a Family S of Subsets of U (U,S)
String Matching
C++ Program to Implement the String Search Algorithm for Short Text Sizes
C++ Program to Implement Knuth–Morris–Pratt Algorithm (KMP)
C++ Program to Implement Z-Algorithm
C++ Program to Implement Boyer-Moore Algorithm for String Matching
C++ Program to Repeatedly Search the Same Text (such as Bible by building a Data Structure)
C++ Program to Implement Aho-Corasick Algorithm for String Matching
C++ Program to Implement the Program Used in grep/egrep/fgrep
C++ Program to Implement Rabin-Karp Algorithm
C++ Program to Perform Naive String Matching
C++ Program to Perform Finite State Automaton based Search
C++ Program to Implement Bitap Algorithm for String Matching
C++ Program to Implement Commentz-Walter Algorithm
C++ Program to Implement Zhu–Takaoka String Matching Algorithm
C++ Program to Perform String Matching Using String Library
C++ Program to Implement String Matching Using Vectors
Approximate String Matching
C++ Program to Use Dynamic Programming to Solve Approximate String Matching
C++ Program to Implement Bit Parallel Algorithm for approximate String Matching
C++ Program to Implement Hirschberg’s Clever Recursive Algorithm
C++ Program to Implement Brute-Force Approach for Approximate String Matching
C++ Program to Implement Levenshtein Distance Computing Algorithm
C++ Program to Implement Wagner and Fisher Algorithm for online String Matching
Cryptography
C++ Program to Implement Caesar Cypher
C++ Program to Encode a Message Using Playfair Cipher
C++ Program to Decode a Message Encoded Using Playfair Cipher
C++ Program to Implement the One Time Pad Algorithm
C++ Program to Implement the MD5 Algorithm
C++ Program to Implement the RSA Algorithm
C++ Program to Implement the Checksum Method for Small String Messages and Detect If the Received message is same as the Transmitted
C++ Program to Implement the Monoalphabetic Cypher
C++ Program to Implement the Hill Cypher
C++ Program to Implement the Vigenere Cypher
C++ Program to Perform Cryptography Using Transposition Technique
C++ Program to Implement Affine Cipher
Finite State Machine Minimization
C++ Program to Minimize the Number of States in a Deterministic Finite Automata
C++ Program to Construct DFA from NFA
C++ Program to Construct NFA for a Given Expression
Longest Common SubString/SubSequence
C++ Program to Implement Kadane’s Algorithm
C++ Program to Find Length of Longest Common Substring
C++ Program to Find the Longest Increasing Subsequence of a Given Sequence
C++ Program to Implement Longest Prefix Matching
C++ Program to Find the Shortest Supersequence that Contains Two or more Sequences as Subsequences
Data-Structures
Hashing
C++ Program to Implement Hash Tables
C++ Program to Implement Hash Tables chaining with Singly Linked Lists
C++ Program to Implement Hash Tables Chaining with Binary Trees
C++ Program to Implement Hash Tables Chaining with Doubly Linked Lists
C++ Program to Implement Hash Tables Chaining with List Heads
C++ Program to Implement Hash Tables with Linear Probing
C++ Program to Implement Hash Tables with Quadratic Probing
C++ Program to Implement Hash Tables with Double Hashing
C++ Program to Implement Hash Tree
C++ Program to Implement Hash List
C++ Program to Implement Hash Tree
C++ Program to Implement prefix Hash Tree
C++ Program to Implement Rolling Hash
C++ Program to Implement CountMinSketch
C++ Program to Implement Min Hash
C++ Program to Implement Distributed Hash table
Heaps
C++ Program to Implement Heap
C++ Program to Implement Binary Heap
C++ Program to Implement Weak Heap
C++ Program to Implement Binomial Tree
C++ Program to Implement Fibonacci Heap
C++ Program to Implement LeftList Heap
C++ Program to Implement Skew Heap
C++ Program to Implement Ternary Heap
C++ Program to Implement D-ary-Heap
C++ Program to Implement Pairing Heap
C++ Program to Implement Treap
C++ Program to Implement Min Heap
C++ Program to Implement Max Heap
Array, Vector, Stack, Queue and Linked List
C++ Program to Implement Suffix Array
C++ Program to Implement Parallel Array
C++ Program to Implement Sorted Array
C++ Program to Implement Sparse Array
C++ Program to Implement Sparse Matrix
C++ Program to Implement Variable length array
C++ Program to Implement Vector
C++ Program to Implement Bit Array
C++ Program to Implement Adjacency List
C++ Program to Implement Adjacency Matrix
C++ Program to Implement Graph Structured Stack
C++ Program To Implement Singly Linked List
C++ Program To Implement Circular Singly Linked List
C++ Program To Implement Doubly Linked List
C++ Program To Implement Circular Doubly Linked List
C++ Program To Implement Self Organising List
C++ Program to Implement Unrolled Linked List
C++ Program to Implement VList
C++ Program to Implement Xor Linked List
C++ Program to Implement Difference List
C++ Program To Implement Skip List
C++ Program to Implement Stack
C++ Program to Implement Queue using Linked List
C++ Program to Implement Doubly Ended Queue
C++ Program to Implement Pagoda
C++ Program to Implement Direct Addressing Tables
C++ Program to Implement Queue Using Two Stacks
C++ Program to Implement Stack using Two Queues
C++ Program to Implement Circular Queue
C++ Program to Implement Priority Queue
C++ Program to Implement Bloom Filter
C++ Program to Implement LRU Cache
C++ Program to Implement Triply Linked List
C++ Program to Implement Disjoint Set Data Structure
C++ program to Solve Tower of Hanoi Problem using Stacks
C++ Program To Implement Circular Singly Linked List
C++ Program to use Linked List and subtract two large Numbers
C++ Program to use Linked List and add two large Numbers
C++ Program To Implement Doubly Linked List
C++ Program to Implement Sorted Circularly Doubly Linked List
C++ Program to Check for balanced paranthesis by using Stacks
C++ Program to Evaluate an Expression using Stacks
C++ Program to Implement Sorted Singly Linked List
C++ program to Convert a Decimal Number to Binary Number using Stacks
C++ Program to Implement Stack using Linked List
C++ Program to Implement Queue using Linked List
STL
Standard Template Library
C++ Program to Implement Vector in STL
C++ Program to Implement Map in STL
C++ Program to Implement Set in STL
C++ Program to Implement Queue in STL
C++ Program to Implement Priority_queue in STL
C++ Program to Implement String in STL
C++ Program to Implement Sorting containers in STL
C++ Program to Implement Pairs in STL
C++ Program to Implement Stack in STL
C++ Program to Implement Array in STL
C++ Program to Implement Deque in STL
C++ Program to Implement Forward List in STL
C++ Program to Implement List in STL
C++ Program to Implement Multiset in STL
C++ Program to Implement Multimap in STL
C++ Program to Implement Unordered set in STL
C++ Program to Implement Unordered multiset in STL
C++ Program to Implement Set Union in STL
C++ Program to Implement Set Intersection in STL
C++ Program to Implement Set Difference in STL
C++ Program to Implement Set Symmetric difference in STL
C++ Program to Implement Next Permutation in STL
C++ Program to Implement Prev Permutation in STL
C++ Program to Implement LexicoGraphical Compare in STL
Extras :
C++ program to add, subtract, multiply and divide two complex numbers using structures
C++ Program to Implement Strassen’s Algorithm
C++ Program to Perform Optimal Paranthesization Using Dynamic Programming
C++ Program to Find Path Between Two Nodes in a Graph
C++ Program to Check if it is a Sparse Matrix
C++ Program to Find Basis and Dimension of a Matrix
C++ Program to Perform Complex Number Multiplication
C++ Program to Check Multiplicability of Two Matrices
Determinants and Permanents
C++ Program to Check if a Matrix is Invertible
C++ Program to Compute Determinant of a Matrix
Constrainted and UnConstrained Optimization
C++ Program to Find Minimum Value of any Algebraic Expression
C++ Program to Find Maximum Value of any Algebraic Expression
C++ Program to Implement Steepest Descent Method and Compute Local Optima
C++ Program to Implement Conjugate Method and Compute Local Optima
C++ Program to Implement Modular Exponentiation Algorithm
Linear Programming
C++ Program to Find Maximum Value of an Expression and Given 3 Inequalities
C++ Program to Optimize Solution for Employer Applicant Mark Problem Using Linear Programming
Random Number Generation
C++ Program to Generate N Number of Passwords of Length M Each
C++ Program to Generate Date Between Given Range
C++ Program to Generate Randomized Sequence of Given Range of Numbers
C++ Program to Generate Random Hexadecimal Bytes
C++ Program to Generate Tetris Game Using Random Number Generation
C++ Program to Create a Random Bitmap Image
C++ Program to Emulate N Dice Roller
C++ Program to Use rand and srand Functions
C++ Program to Implement the linear congruential generator for Pseudo Random Number Generation
C++ Program to Generate Random Numbers Using Middle Square Method
C++ Program to Generate Random Numbers Using Multiply with Carry Method
C++ Program to Generate Random Numbers Using Probability Distribution Function
C++ Program to Implement Inversion Method for Random Number Generation
C++ Program to Perform Random Number Generation Using Inversion Method
C++ Program to Implement Fisher-Yates Algorithm for Array Shuffling
C++ Program to Implement Park-Miller Random Number Generation Algorithm
C++ Program to Implement Naor-Reingold Pseudo Random Function
Factoring and Primality Testing
C++ Program to Implement wheel Sieve to Generate Prime Numbers Between Given Range
C++ Program to Implement Sieve of eratosthenes to Generate Prime Numbers Between Given Range
C++ Program to Implement Sieve of Atkin to Generate Prime Numbers Between Given Range
C++ Program to Implement Segmented Sieve to Generate Prime Numbers Between Given Range
C++ Program to Implement the Rabin-Miller Primality Test to Check if a Given Number is Prime
C++ Program to Implement the Solovay-Strassen Primality Test to Check if a Given Number is Prime
C++ Program to Find the GCD and LCM of n Numbers
C++ Program to Perform the Unique Factorization of a Given Number
C++ Program to Find GCD of Two Numbers Using Recursive Euclid Algorithm
C++ Program to Generate Prime Numbers Between a Given Range Using the Sieve of Sundaram
C++ Program to Perform Baillie-PSW Primality Test
C++ Program to Implement Fermat Primality Test
Arbitrary-Precision Arithmetic
C++ Program to Perform Addition Operation Using Bitwise Operators
C++ Program to Implement Booth’s Multiplication Algorithm for Multiplication of 2 signed Numbers
C++ Program to Implement the Schonhage-Strassen Algorithm for Multiplication of Two Numbers
C++ Program to Perform Arithmetic Operations on Numbers of Size Greater than that of Int Without Using any Data Type of Size Greater than Int
C++ Program to Implement Russian Peasant Multiplication
C++ Program to Implement Euler Theorem
C++ Program to Implement Extended Eucledian Algorithm
C++ Program to Implement Fermat’s Little Theorem
Knapsack Problem
C++ Program to Solve the 0-1 Knapsack Problem
C++ Program to Solve the Fractional Knapsack Problem
C++ Program to Perform Partition of an Integer in All Possible Ways
C++ Program to Fill Given n Numbers into a Given N Number and Ensure that Minimum is Left from N
C++ Program to Implement the Bin Packing Algorithm
C++ Program to Solve Knapsack Problem Using Dynamic Programming
C++ Program to Calculate Maximum Payoff by ReOrdering Two Given Sets
Discrete Fourier Transform
C++ Program to Compute DFT Coefficients Directly
C++ Program to Compute Discrete Fourier Transform Using Naive Approach
C++ Program to Compute Discrete Fourier Transform Using the Fast Fourier Transform Approach
C++ Perform to a 2D FFT Inplace Given a Complex 2D Array
Factorials and Fibonacci Numbers
C++ Program to Find Factorial of a Number using Recursion
C++ Program to Find Factoial of a Number using Iteration
C++ Program to Find Factoial of a Number using Dynamic Programming
C++ Program to Find Factoial of Large Numbers
C++ Program to Find Fibonacci Numbers using Recursion
C++ Program to Find Fibonacci Numbers using Iteration
C++ Program to Find Fibonacci Numbers using Dynamic Programming
C++ Program to Find Fibonacci Numbers using Matrix Exponentiation
Combinatorial Problems & Algorithms
Sorting
C++ Program to Implement Radix Sort
C++ Program to Implement Bucket Sort
C++ Program to Implement Bubble Sort
C++ Program to Implement Heap Sort
C++ Program to Implement Merge Sort
C++ Program to Implement Selection Sort
C++ Program to Implement Insertion Sort
C++ Program to Implement Quick Sort Using Randomization
C++ Program to Implement Shell Sort
C++ Program to Implement Sorting of Less than 100 Numbers in O(n) Complexity
C++ Program to Perform Sorting Using B-Tree
C++ Program to Perform Quick Sort on Large Number of Elements
C++ Program to Implement Merge Sort using Linked List
C++ Program to Implement Counting Sort
C++ Program to Perform the Shaker Sort
C++ Program to Perform Stooge Sort
C++ Program to Count Inversion in an Array
Searching
C++ Program to Compare Binary and Sequential Search
C++ Program to Perform Searching Using Self-Organizing Lists
C++ Program to Implement a Binary Search Algorithm for a Specific Search Sequence
C++ Program to Search for an Element in a Binary Search Tree
C++ Program to Implement Multi-Threaded Version of Binary Search Tree
C++ Program to Perform Searching Based on Locality of Reference
C++ Program to Implement Interpolation Search Algorithm
C++ Program to Find kth Largest Element in a Sequence
C++ Program to Search Sorted Sequence Using Divide and Conquer with the Aid of Fibonacci Numbers
C++ Program to Perform Uniform Binary Search
C++ Program to Find Minimum Element in an Array using Linear Search
C++ Program to Find Maximum Element in an Array using Binary Search
C++ Program to Find the Minimum element of an Array using Binary Search approach
C++ Program to Find the peak element of an array using Binary Search approach
Median and Selection
C++ Program to Find Second Smallest of n Elements with Given Complexity Constraint
C++ Program to Implement Quick Sort with Given Complexity Constraint
C++ Program to List the kth Quantiles of a Set within Given Time Constraint
C++ Program to Find k Numbers Closest to Median of S, Where S is a Set of n Numbers
C++ Program to Find Median of Two Sorted Arrays
C++ Program to Find ith Largest Number from a Given List Using Order-Statistic Algorithm
C++ Program to Find kth Smallest Element by the Method of Partitioning the Array
C++ Program to Find the Mode in a Data Set
C++ Program to Find the Number of occurrences of a given Number using Binary Search approach
C++ Program to Find the Median of two Sorted Arrays using Binary Search Approach
C++ Program to Find the maximum subarray sum O(n^2) time(naive method)
C++ Program to Find the maximum subarray sub using Divide and Conquer Approach
Generating Permutations and Combinations
C++ Program to Implement the Alexander Bogomolny’s UnOrdered Permutation Algorithm for Elements From 1 to N
C++ Program to Permute All Letters of an Input String
C++ Program to Implement Heap’s Algorithm for Permutation of N Numbers
C++ Program to Generate All Possible Combinations of a Given List of Numbers
C++ Program to Generate a Sequence of N Characters for a Given Specific Case
C++ Program to Compute Combinations using Factorials
C++ Program to Compute Combinations using Recurrence Relation for nCr
C++ Program to Compute Combinations using Matrix Multiplication
C++ Program to Find the Number of Permutations of a Given String
Generating Subsets
C++ Program to Generate All Subsets of a Given Set in the Gray Code Order
C++ Program to Generate All Subsets of a Given Set in the Lexico Graphic Order
C++ Program to Implement the Binary Counting Method to Generate Subsets of a Set
C++ Program to Generate a Random Subset by Coin Flipping
C++ Program to Generate All Possible Subsets with Exactly k Elements in Each Subset
C++ Program to Generate All Possible Combinations Out of a,b,c,d,e
C++ Program to Generate All Pairs of Subsets Whose Union Make the Set
C++ Program to Generate All Sequences out of a Binary Sequence without Altering 0 Positions while Changing 1
Generating Partitions
C++ Program to Perform Integer Partition for a Specific Case
C++ Program to Generate All the Set Partitions of n Numbers Beginning from 1 and so on
C++ Program to Generate Random Partition out of a Given Set of Numbers or Characters
C++ Program to Find the Number of Ways to Write a Number as the Sum of Numbers Smaller than Itself
C++ Program to Solve Palindrome Partitioning Problem
Generating Graphs
C++ Program to Generate a Random UnDirected Graph for a Given Number of Edges
C++ Program to Generate a Random Directed Acyclic Graph DAC for a Given Number of Edges
C++ Program to Create a Random Graph Using Random Edge Generation
C++ Program to Construct a Random Graph by the Method of Random Edge Selection
C++ Program to Construct a Random Graph by the Method of Preferencial Attachment
C++ Program to Create the Prufer Code for a Tree
C++ Program to Generate a Graph for a Given Fixed Degree Sequence
C++ Program to Generate a Semi-Random Collection of Graphs by Using the Technique of Edge-Flipping
C++ Program to Check if any Graph is Possible to be Constructed for a Given Degree Sequence
C++ Program to Describe the Representation of Graph using Adjacency Matrix
C++ Program to Represent Graph Using Incidence Matrix
C++ Program to Describe the Representation of Graph using Adjacency List
C++ Program to Describe the Representation of Graph using Incidence List
C++ Program to Represent Graph Using 2D Arrays
C++ Program to Represent Graph Using Linked List
Other
C++ program to Solve Tower of Hanoi Problem using Binary Value
Graph Problems & Algorithms
Connected Components
C++ Program to Solve any Linear Equation in One Variable
C++ Program to Check whether Undirected Graph is Connected using BFS
C++ Program to Check the Connectivity of Directed Graph Using BFS
C++ Program to Check whether Undirected Graph is Connected using DFS
C++ Program to Check whether Directed Graph is Connected using DFS
C++ Program to Test Using DFS Whether a Directed Graph is Weakly Connected or Not
C++ Program to Check Whether a Graph is Strongly Connected or Not
C++ Program to Check if an Undirected Graph is a Tree or Not Using DFS
C++ Program to Check if an Directed Graph is a Tree or Not Using DFS
C++ Program to Find the Connected Components of an UnDirected Graph
C++ program to find if a given undirected graph is biconnected
C++ Program to Create a Minimal Set of All Edges Whose Addition will Convert it to a Strongly Connected DAG
C++ Program to Find Strongly Connected Components in Graphs
Topological Sorting
C++ Program to Apply DFS to Perform the Topological Sorting of a Directed Acyclic Graph
C++ Program to Check Whether Topological Sorting can be Performed in a Graph
C++ Program to Create a Random Linear Extension for a DAG
C++ Program to Generate All the Possible Linear Extensions of a DAG
C++ Program to Remove the Edges in a Given Cyclic Graph such that its Linear Extension can be Found
C++ Program to Check Cycle in a Graph using Topological Sort
C++ Program for Topological Sorting in Graphs
Minimum Spanning Tree
C++ Program to Apply the Prim’s Algorithm to Find the Minimum Spanning Tree of a Graph
C++ Program to Apply the Kruskal’s Algorithm to Find the Minimum Spanning Tree of a Graph
C++ Program to Use Boruvka’s Algorithm to Find the Minimum Spanning Tree
C++ Program to Create a MST of a Set of Points Spread in Two Dimensions Using Delaunay Triangulation
C++ Program to Give an Efficient Algorithm to Compute the Second-Best Minimum Spanning Tree of G
C++ Program to Find MST(Minimum Spanning Tree) using Kruskal’s Algorithm
C++ Program to Find MST(Minimum Spanning Tree) using Prim’s Algorithm
Shortest Path
C++ Program to Find the Shortest Path Between Two Vertices Using Dijkstra’s Algorithm
C++ Program to Find the Shortest Path from Source Vertex to All Other Vertices in Linear Time
C++ Program to Use the Bellman-Ford Algorithm to Find the Shortest Path Between Two Vertices Assuming that Negative Size Edges Exist in the Graph
C++ Program to Implement Shortest Path Algorithm for DAG Using Topological Sorting
C++ Program to Find Shortest Path Between All Vertices Using Floyd-Warshall’s Algorithm
C++ Program to Find the Shortest Cycle in a Graph
C++ Program to Implement Dijkstra’s Algorithm Using Queue
C++ Program to Implement Dijkstra’s Algorithm using Priority_queue(Heap)
C++ Program to Implement Dijkstra’s Algorithm Using Set
C++ Program to Implement Bellmanford Algorithm
C++ Program to Implement Floyd-Warshall Algorithm
C++ Program to Implement Johnson’s Algorithm
C++ Program to Find SSSP(Single Source Shortest Path) in DAG(Directed Acyclic Graphs)
Transitive Closure and Reduction
C++ Program to Find the Transitive Closure of a Given Graph G
C++ Program to Construct Transitive Closure Using Warshall’s Algorithm
C++ Program to Find Transitive Closure of a Graph
Matching
C++ Program to Solve a Matching Problem for a Given Specific Case
C++ Program to Rearrange Letters of a String such that no More than 1 Letters should Retain the Same Position
C++ Program to Solve a Matching Problem for a Given Specific Case
C++ Program to Implement the Hungarian Algorithm for Bipartite Matching
C++ Program to Implement the Edmond’s Algorithm for Maximum Cardinality Matching
C++ Program to Solve a Matching Problem for a Given Specific Case
Eulerian Cycle/Chinese Postman
C++ Program to Check Whether an Undirected Graph Contains a Eulerian Cycle
C++ Program to Check Whether an Undirected Graph Contains a Eulerian Path
C++ Program to Check Whether a Directed Graph Contains a Eulerian Cycle
C++ Program to Check Whether a Directed Graph Contains a Eulerian Path
C++ Program to Give an Implementation of the Traditional Chinese Postman Problem
C++ Program to Implement Euler Circuit Problem
Edge and Vertex Connectivity
C++ Program to Check Whether it is Weakly Connected or Strongly Connected for a Directed Graph
C++ Program to Check whether Graph is Biconnected
C++ Program to Implement Max-Flow and Min-Cut Theorem
C++ Program to Find the Edge Connectivity of a Graph
C++ Program to Find the Vertex Connectivity of a Graph
C++ Program to Check whether Graph is a Bipartite using 2 Color Algorithm
C++ Program to Check whether Graph is a Bipartite using BFS
C++ Program to Check whether Graph is a Bipartite using DFS
C++ Program to Find Maximum Number of Edge Disjoint Paths
C++ Program to Find Number of Articulation points in a Graph
Drawing Trees
C++ Program to Perform Dictionary Operations in a Binary Search Tree
C++ Program to Create a Balanced Binary Tree of the Incoming Data
C++ Program to Implement Binary Search Tree
C++ Program to Construct an Expression Tree for a Given Prefix Expression
C++ Program to Construct an Expression Tree for a Postfix Expression
C++ Program to Construct an Expression Tree for an Infix Expression
C++ Program to Perform Preorder Non-Recursive Traversal of a Given Binary Tree
C++ Program to Perform Postorder Non-Recursive Traversal of a Given Binary Tree
C++ Program to Perform Inorder Non-Recursive Traversal of a Given Binary Tree
C++ Program to Perform Preorder Recursive Traversal of a Given Binary Tree
C++ Program to Perform Inorder Recursive Traversal of a Given Binary Tree
C++ Program to Perform Postorder Recursive Traversal of a Given Binary Tree
C++ Program to Sort an Array of 10 Elements Using Heap Sort Algorithm
C++ Program to Implement Double Order Traversal of a Binary Tree
C++ Program to Perform Left Rotation on a Binary Search Tree
C++ Program to Perform Right Rotation on a Binary Search Tree
C++ Program to Print the Kind of Rotation the AVL Tree is Undergoing When you Add an Element or Delete an Element
C++ Program to Print only Odd Numbered Levels of a Tree
C++ Program to Find Deepest Left Leaf in a Binary Tree
C++ Program to Remove All nodes which don’t lie in any Path with Sum >= K
C++ Program to Check if a Given Binary Tree is an AVL Tree or Not
C++ Non-recursive program to delete an entire binary tree
C++ Program to Find Whether a Path Exists Between 2 Given Nodes
C++ Program to Check Whether an Input Binary Tree is the Sub Tree of the Binary Tree
C++ Program to Check if a Binary Tree is a BST
C++ Program to Implement Sorted Linked List to Balanced BST
C++ Program to Implement Segment Tree
C++ Program to Implement B-Tree
C++ Program to Implement Interval Tree
C++ Program to Implement Range Tree
C++ Program to Implement Ternary Seach Tree
C++ Program to Implement AA Trees
C++ Program to Implement AVL Trees
C++ Program to Implement Cartesian Tree
C++ Program to Implement Splay Tree
C++ Program to Implement T Tree
C++ Program to Implement Tango Tree
C++ Program to Implement Threaded Binary Tree
C++ Program to Implement Top Tree
C++ Program to Implement Weight Balanced Tree
C++ Program to Implement Trie
C++ Program to Implement Suffix Tree
C++ Program to Implement Red Black Tree
C++ Program to Implement Randomized Binary Search Tree
C++ Program to Implement ScapeGoat Tree
C++ Program to Implement Self Balancing Binary Search Tree
C++ Program to Find Lowest Common Ancestor in a Binary Search Tree
C++ Program To Check Whether a Given Tree is Binary Search Tree
C++ Program to Implement Ternary Tree
C++ Program to Implement Range Tree
C++ Program to Implement Interval Tree
C++ Program to Implement Segment Tree
C++ Program to Implement Fusion Tree
C++ Program to Implement B+ Tree
C++ Program For Inorder Tree Traversal without Recursion
C++ Program to Implement B-Tree
C++ Program to Find the Minimum value of Binary Search Tree
C++ Program to Implement a Binary Search Tree using Linked Lists
C++ Program to Implement Expression Tree Algorithm
Planarity Detection and Embedding
C++ Program to Check Whether a Graph is Planar or Not
C++ Program to Implement the Hopcroft and Tarjan Algorithm
C++ Program to Implement the Booth and Lueker Algorithm to Check for Planarity
Graph Search
C++ Program to Implement Beam Search Algorithm
C++ Program to Implement Best First Search
C++ Program to Implement Bidirectional Search
C++ Program to Implement all Forward Edges in a Graph
C++ Program to Implement Find all Cross Edges in a Graph
C++ Program to Find all Back Edges in a Graph
Depth First Search (DFS) Implementation using C++
C++ Program to Implement Iterative Deepening
C++ Program to Implement Uniform-Cost Search
Other
C++ Program to Find Inverse of a Graph Matrix
C++ Program to Find Transpose of a Graph Matrix
C++ Program to Implement Network_Flow Problem
Network Flow
C++ Program to Implement The Edmonds-Karp Algorithm
C++ Program to Implement Ford–Fulkerson Algorithm
Graph Traversal
C++ Program to Traverse a Graph using BFS
C++ Program to Traverse a Graph using DFS
Hard Graph Problems & Algorithms
Clique
C++ Program to Find the Maximum Size Clique in a Graph
C++ Program to Find a Clique by Using the Technique of the Most Dense Subgraph
C++ Program to Find the Largest clique in a Planar Graph
C++ Program to Solve the Decision Problem of Testing Whether a Graph Contains a Clique Larger than a Given Size
C++ Program to Find a Maximum Weight Clique in a Weighted Graph
C++ Program to Find All the Cliques of a Given Size k
C++ Program to Find the Largest Independent Set in a Graph by Comravplements and Find the Clique of this Graph
C++ Program to Find Independent Sets in a Graph by Graph Coloring
C++ Program to Find the Maximum Independent Set of a Tree in Linear Time
C++ Program to Find Size of the Largest Independent Set(LIS) in a Given a Binary Tree
C++ Program to Find Size of the Largest Independent Set(LIS) in a Given an N-ary Tree
Vertex Cover
C++ Program to Implement a Heuristic to Find the Vertex Cover of a Graph
C++ Program to Solve the Dominating Set Problem
C++ Program to Check Whether a Vertex Cover of Size k Exists
Traveling Salesman Problem
C++ Program to Solve Travelling Salesman Problem for Unweighted Graph
C++ Program to Implement Branch and Bound Method to Perform a Combinatorial Search
C++ Program to Solve TSP Using Minimum Spanning Trees
C++ Program to Solve TSP Using Incremental Insertion Method
C++ Program to Find a k-Optimal Tour for TSP
C++ Program to Implement Held-Karp Algorithm
C++ Program to Implement Nearest Neighbour Algorithm
C++ Program to Implement Traveling Salesman Problem using Nearest neighbour Algorithm
Hamiltonian Cycle
C++ Program to Find Hamiltonian Cycle
C++ Program to Find the Longest Path in a DAG
C++ Program to Check if a Given Graph must Contain Hamiltonian Cycle or Not
C++ Program to Convert Hamiltonian Cycle into Path
C++ Program to Check Whether a Hamiltonian Cycle or Path Exists in a Given Graph
Graph Partition
C++ Program to Find Minimum Number of Edges to Cut to make the Graph Disconnected
C++ Program to Partition a Tree from a Given Element using DFS
C++ Program to Find the Maximum Cut in a Graph
C++ Program to Perform Spectral Partitioning of a Graph
Vertex Coloring
C++ Program to Perform Graph Coloring on Bipartite Graphs
C++ Program to Check if a Given Graph is Bipartite
C++ Program to Perform Edge Coloring of a Graph
C++ Program to Use Color Interchange Method to Perform Vertex Coloring of Graph
C++ Program to Demonstrate the Implementation of 4-Color Problem
C++ Program to Perform Greedy Coloring
Edge Coloring
C++ Program to Implement the Vizing’s Theorem
C++ Program to Find Chromatic Index of Cyclic Graphs
C++ Program to Perform Edge Coloring on Complete Graph
C++ Program to Perform Edge Coloring to the Line Graph of an Input Graph
C++ Program to Find the Arboricity of a Graph
C++ Program to Solve the Open Shop Scheduling Problem
Steiner Tree
C++ Program to Find the Steiner Tree of a Given Graph
C++ Program to Apply Heuristic Based on Shortest Path to Find Steiner Tree
C++ Program to Check if a Steiner Tree Size k Exists for a Graph
Feedback Edge/Vertex Set
C++ Program to Check Whether Graph is DAG
C++ Program to Find a Good Feedback Edge Set in a Graph
C++ Program to Find a Good Feedback Vertex Set
Computational Geometry Problems & Algorithms
Robust Geometric Primitives
C++ Program to Apply Above-Below-on Test to Find the Position of a Point with respect to a Line
C++ Program to Compute the Area of a Triangle Using Determinants
C++ Program to Compute the Volume of a Tetrahedron Using Determinants
C++ Program to Find the Area of any Polygon Using Triangulation
C++ Program to Implement Slicker Algorithm that avoids Triangulation to Find Area of a Polygon
C++ Program to Use Above Below Primitive to Test Whether Two Lines Intersect
C++ Program to Check if a Point d lies Inside or Outside a Circle Defined by Points a, b, c in a Plane
C++ Program to Apply Delaunay Triangulation Algorithm
C++ Program to Solve the Directed Segment Problem
C++ Program to Solve the Directed Segment Problem
C++ Program to Compute Cross Product of Two Vectors
Convex Hull
C++ Program to Implement Graham Scan Algorithm to Find the Convex Hull
C++ Program to Implement Gift Wrapping Algorithm in Two Dimensions
C++ Program to Implement Jarvis March to Find the Convex Hull
C++ Program to Implement Quick Hull Algorithm to Find Convex Hull
C++ Program to Implement Chan’s Algorithm
C++ Program to Implement Incremental Method to Find the Convex Hull
C++ Program to Implement Divide and Conquer Method to Find the Convex Hull
C++ Program to Implement Prune and Search Method to Find the Convex Hull
Triangulation
C++ Program to Triangulate by Adding to the Convex-Hull Diagonals from the First Point to All of the Others
C++ Program to Implement Delaunay Triangulation to Perform Triangulation
C++ Program to Implement “Triangle” by Jonathan Shewchuk
C++ Program to Implement Fortune’s Sweep2 Code
C++ Program to Implement Flip Algorithm for Non-Delaunay Triangles
C++ Program to Use SweepHull for Fast Delaunay Triangulation
Voronoi Diagrams
C++ Program to Implement Voronoi Diagram Using Fortune’s Algorithm
C++ Program to Implement Voronoi Diagram Using Divide and Conquer Algorithm
C++ Program to Implement Lloyd’s Algorithm
C++ Program to Implement Voronoi Diagram Problem Using Graphs
C++ Program to Implement Bowyer-Watson Algorithm
Nearest Neighbor Search
C++ Program to Find the Nearest Neighbour Using K-D Tree Search
C++ Program to Find Nearest Neighbour Using Voronoi Diagram
C++ Program to Find Nearest Neighbour for Static Data Set
C++ Program to Find Nearest Neighbour for Dynamic Data Set
C++ Program to Find Nearest Neighbour Using Linear Search
Range Search
C++ Program to Construct K-D Tree for 2 Dimensional Data (assume static data)
C++ Program to Perform Insertion in a 2 Dimension K-D Tree
C++ Program to Perform Searching in a 2-Dimension K-D Tree
C++ Program to Find the Node with Minimum Value (with respect to that cutting Dimension) for a Given Node, and a Cutting Dimension
C++ Program to Perform Deletion in K-D Tree
C++ Program to Perform 3-Dimensional Range Query
C++ Program to Perform 1-Dimensional Range Query
C++ Program to Perform Range Query in 2-Dimension
C++ Program to Perform Dynamic Range Searching where Data is Dynamically Inserted or Deleted
C++ Program to Perform Partial Key Search in a K-D Tree
Point Location
C++ Program to Check Whether a Given Point is in a Given Polygon
C++ Program to Find Location of a Point by Triangulation of the Given Polygon
C++ Program to Find Location of a Point by Constructing K*K Grid on a Given Polygon
C++ Program to Find Location of a Point Placed in Three Dimensions Using K-D Trees
C++ Program to Find the Point Location Using Slab Method
C++ Program to Find Location of a Point by Trapezoidal Decomposition
Intersection Detection
C++ Program to Perform Sphere Sphere Intersection Testing
C++ Program to Perform Interval-Interval Intersection Testing
C++ Program to Perform AABB-AABB Intersection Testing
C++ Program to Perform Sphere-AABB Intersection Testing
C++ Program to Perform Ray-Sphere Intersection Testing
C++ Program to Find Ray-Polygon Intersection Point
C++ Program to Perform Polygon Containment Test
C++ Program to Perform Brute Force Collision Detection
C++ Program to Check Visibility of a Point X to Y
C++ Program to Implement Plane Sweep Algorithms for Intersection of Lines
Bin Packing
C++ Program to Implement First Fit Decreasing for 1-D Objects and M Bins
C++ Program to Implement First Fit Decreasing for 1-D Objects Using Binary Tree
C++ Program to Find the Minimum Area of a Rectangle to Fit N Rectangles of Different Sizes
C++ Program to Find Largest Rectangular Area in a Histogram
Polygon Partitioning
C++ Program to Implement Hertel-Mehlhorn Heuristic for Convex Decomposition Using Diagonals
C++ Program to Delete All Lines from a Polygon such that it becomes a Convex Polygon
C++ Program to Perform Triangulation to Partition the Polygon in Triangles
C++ Program to Perform Optimal Convex Partitioning Using Dynamic Programming
Simplifying Polygons
C++ Program for Douglas-Peucker Algorithm Implementation
C++ Program to Implement Chazelle’s Linear time Triangulation Algorithm
Shape Similarity
C++ Program to Perform Housdorff based Image Comparison
Motion Planning
C++ Program to Construct a Visibility Graph of the Polygonal Obstacles
C++ Program to Find a Set of Legal Configuration Space Points by Randon Sampling
Maintaining Line Arrangements
C++ Program to Perform Degeneracy Testing on a Set of n Lines
C++ Program to Perform Insertion in a Line Arrangement
C++ Program to Construct a Full Arrangement of n Lines
C++ Program to Perform Intersection Detection of Line Arrangement
C++ Program to Find a Point P that Satisfies Maximum Number of such Constraints for a Given Set of Constraints of type y
C++ Program to Check Whether a Given Points are Colinear or Not
C++ Program to Implement Sweepline Algorithm
C++ Program to Solve N-Queen Problem
Set & String
Set Cover
C++ Program to Find the Smallest Set of Vertices that will Cover Each Edge atleast once.
C++ Program to Find an Optimal Solution for Set Cover Problem Using Backtracking
C++ Program to Use Integer Programming Formula to Solve the Set Cover Problem
C++ Program to Solve Set Cover Problem assuming at max 2 Elements in a Subset
C++ Program to Implement Boolean Logic Minimization Using Set Cover Problem
C++ Program to Use Greedy Approach to Solve Set Cover Problem
Set Packing
C++ Program to Implement Exhaustive Search Algorithm for Set Packing
C++ Program to Implement Heuristic Approach to Solve Set Packing
C++ Program to Check if a Set Packing is Possible of Size k for a Given Pair of Universe U and a Family S of Subsets of U (U,S)
String Matching
C++ Program to Implement the String Search Algorithm for Short Text Sizes
C++ Program to Implement Commentz-Walter Algorithm
C++ Program to Implement Zhu–Takaoka String Matching Algorithm
C++ Program to Perform String Matching Using String Library
C++ Program to Implement String Matching Using Vectors
Approximate String Matching
C++ Program to Implement Bit Parallel Algorithm for approximate String Matching
C++ Program to Implement Hirschberg’s Clever Recursive Algorithm
C++ Program to Implement Brute-Force Approach for Approximate String Matching
C++ Program to Implement Levenshtein Distance Computing Algorithm
C++ Program to Implement Wagner and Fisher Algorithm for online String Matching
Cryptography
C++ Program to Construct NFA for a Given Expression
Longest Common SubString/SubSequence
C++ Program to Find Length of Longest Common Substring
C++ Program to Find the Longest Increasing Subsequence of a Given Sequence
C++ Program to Implement Longest Prefix Matching
C++ Program to Find the Shortest Supersequence that Contains Two or more Sequences as Subsequences
Data-Structures
C++ Program to Implement Hash Tables chaining with Singly Linked Lists
C++ Program to Implement Hash Tables Chaining with Binary Trees
C++ Program to Implement Hash Tables Chaining with Doubly Linked Lists
C++ Program to Implement Hash Tables Chaining with List Heads
C++ Program to Implement Hash Tables with Linear Probing
C++ Program to Implement Hash Tables with Quadratic Probing
C++ Program to Implement Hash Tables with Double Hashing
C++ Program to Implement Hash Tree
C++ Program to Implement Hash List
C++ Program to Implement Hash Tree
C++ Program to Implement prefix Hash Tree
C++ Program to Implement Rolling Hash
C++ Program to Implement CountMinSketch
C++ Program to Implement Min Hash
C++ Program to Implement Distributed Hash table
Heaps
C++ Program to Implement Binary Heap
C++ Program to Implement Weak Heap
C++ Program to Implement Binomial Tree
C++ Program to Implement Fibonacci Heap
C++ Program to Implement LeftList Heap
C++ Program to Implement Skew Heap
C++ Program to Implement Ternary Heap
C++ Program to Implement D-ary-Heap
C++ Program to Implement Pairing Heap
C++ Program to Implement Treap
C++ Program to Implement Min Heap
C++ Program to Implement Max Heap
Array, Vector, Stack, Queue and Linked List
C++ Program to Implement Parallel Array
C++ Program to Implement Sorted Array
C++ Program to Implement Sparse Array
C++ Program to Implement Sparse Matrix
C++ Program to Implement Variable length array
C++ Program to Implement Vector
C++ Program to Implement Bit Array
C++ Program to Implement Adjacency List
C++ Program to Implement Adjacency Matrix
C++ Program to Implement Graph Structured Stack
C++ Program To Implement Singly Linked List
C++ Program To Implement Circular Singly Linked List
C++ Program To Implement Doubly Linked List
C++ Program To Implement Circular Doubly Linked List
C++ Program To Implement Self Organising List
C++ Program to Implement Unrolled Linked List
C++ Program to Implement VList
C++ Program to Implement Xor Linked List
C++ Program to Implement Difference List
C++ Program To Implement Skip List
C++ Program to Implement Stack
C++ Program to Implement Queue using Linked List
C++ Program to Implement Doubly Ended Queue
C++ Program to Implement Pagoda
C++ Program to Implement Direct Addressing Tables
C++ Program to Implement Queue Using Two Stacks
C++ Program to Implement Stack using Two Queues
C++ Program to Implement Circular Queue
C++ Program to Implement Priority Queue
C++ Program to Implement Bloom Filter
C++ Program to Implement LRU Cache
C++ Program to Implement Triply Linked List
C++ Program to Implement Disjoint Set Data Structure
C++ program to Solve Tower of Hanoi Problem using Stacks
C++ Program To Implement Circular Singly Linked List
C++ Program to use Linked List and subtract two large Numbers
C++ Program to use Linked List and add two large Numbers
C++ Program To Implement Doubly Linked List
C++ Program to Implement Sorted Circularly Doubly Linked List
C++ Program to Check for balanced paranthesis by using Stacks
C++ Program to Evaluate an Expression using Stacks
C++ Program to Implement Sorted Singly Linked List
C++ program to Convert a Decimal Number to Binary Number using Stacks
C++ Program to Implement Stack using Linked List
C++ Program to Implement Queue using Linked List
STL
C++ Program to Implement List in STL
C++ Program to Implement Multiset in STL
C++ Program to Implement Multimap in STL
C++ Program to Implement Unordered set in STL
C++ Program to Implement Unordered multiset in STL
C++ Program to Implement Set Union in STL
C++ Program to Implement Set Intersection in STL
C++ Program to Implement Set Difference in STL
C++ Program to Implement Set Symmetric difference in STL
C++ Program to Implement Next Permutation in STL
C++ Program to Implement Prev Permutation in STL
C++ Program to Implement LexicoGraphical Compare in STL
Extras :
C++ program to add, subtract, multiply and divide two complex numbers using structures