File List
Here is a list of all documented files with brief descriptions:

backtracking |
graph_coloring.cpp | Prints the assigned colors using Graph Coloring algorithm
knight_tour.cpp | Knight's tour algorithm
minimax.cpp | Returns which is the longest/shortest number using minimax algorithm
n_queens.cpp | Eight Queens puzzle
n_queens_all_solution_optimised.cpp | N queens all optimized
nqueen_print_all_solutions.cpp | Eight Queens puzzle, printing all solutions
rat_maze.cpp | Implements <a href="https://www.codesdope.com/blog/article/backtracking-to- solve-a-rat-in-a-maze-c-java-pytho/"
sudoku_solve.cpp | Sudoku Solver algorithm
ciphers |
caesar_cipher.cpp | Implementation of Caesar cipher algorithm
hill_cipher.cpp | Implementation of Hill cipher algorithm
morse_code.cpp | Implementation of Morse Code
vigenere_cipher.cpp | Implementation of Vigenère cipher algorithm
xor_cipher.cpp | Implementation of XOR cipher algorithm
data_structures |
cll |
cll.h |
avltree.cpp | A simple tree implementation using nodes
binary_search_tree.cpp | A simple tree implementation using structured nodes
binary_search_tree2.cpp | A generic binary search tree implementation
binaryheap.cpp | A C++ program to demonstrate common Binary Heap Operations
disjoint_set.cpp | Disjoint Sets Data Structure (Disjoint Sets)
linked_list.cpp | Implementation of singly linked list algorithm
linkedlist_implentation_usingarray.cpp | Linked list implementation using Arrays
list_array.cpp | Dynamic Array
queue.h |
queue_using_array.cpp | Implementation of Linear Queue using array
queue_using_two_stacks.cpp |
skip_list.cpp | Data structure for fast searching and insertion in \(O(\log n)\) time
stack.h | This class specifies the basic operation on a stack as a linked list
tree_234.cpp | A demo 2-3-4 tree implementation
trie_modern.cpp | A basic implementation of trie class to store only lower-case strings
trie_tree.cpp | Implementation of Trie data structure for English alphabets in small characters
dynamic_programming |
0_1_knapsack.cpp | Implementation of 0-1 Knapsack Problem
coin_change_topdown.cpp | Minimum coins change problem is a problem used to find the minimum number of coins required to completely reach a target amount
cut_rod.cpp | Implementation of cutting a rod problem
kadane2.cpp | Implementation of Kadane Algorithm
longest_palindromic_subsequence.cpp | Program to find the Longest Palindormic Subsequence of a string
palindrome_partitioning.cpp | Implements Palindrome Partitioning algorithm, giving you the minimum number of partitions you need to make
shortest_common_supersequence.cpp | SCS is a string Z which is the shortest supersequence of strings X and Y (may not be continuous in Z, but order is maintained)
word_break.cpp | Word Break Problem
geometry |
jarvis_algorithm.cpp | Implementation of Jarvis’s algorithm
line_segment_intersection.cpp | Check whether two line segments intersect each other or not
graph |
bidirectional_dijkstra.cpp | Bidirectional Dijkstra Shortest Path Algorithm
breadth_first_search.cpp | Breadth First Search Algorithm (Breadth First Search)
connected_components.cpp | <a href="https://en.wikipedia.org/wiki/Component_(graph_theory)"
connected_components_with_dsu.cpp | Disjoint union
depth_first_search.cpp | Depth First Search Algorithm (Depth First Search)
depth_first_search_with_stack.cpp | Depth First Search Algorithm using Stack (Depth First Search Algorithm)
dijkstra.cpp | <a href="https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm"
hamiltons_cycle.cpp | The implementation of Hamilton's cycle dynamic solution for vertices number less than 20
hopcroft_karp.cpp | Implementation of Hopcroft–Karp algorithm
is_graph_bipartite.cpp | Algorithm to check whether a graph is bipartite
lowest_common_ancestor.cpp | Data structure for finding the lowest common ancestor of two vertices in a rooted tree using binary lifting
graphics |
spirograph.cpp | Implementation of Spirograph
greedy_algorithms |
jumpgame.cpp | Implementation of an algorithm to solve the jumping game problem
hashing |
chaining.cpp | Implementation of hash chains
double_hash_hash_table.cpp | Storage mechanism using double-hashed keys
linear_probing_hash_table.cpp | Storage mechanism using linear probing hash keys
quadratic_probing_hash_table.cpp | Storage mechanism using quadratic probing hash keys
linear_algebra |
gram_schmidt.cpp | Gram Schmidt Orthogonalisation Process
machine_learning |
adaline_learning.cpp | Adaptive Linear Neuron (ADALINE) implementation
kohonen_som_topology.cpp | Kohonen self organizing map (topological map)
kohonen_som_trace.cpp | Kohonen self organizing map (data tracing)
neural_network.cpp | Implementation of Multilayer Perceptron
ordinary_least_squares_regressor.cpp | Linear regression example using Ordinary least squares
vector_ops.hpp | Various functions for vectors associated with <a href="https://en.wikipedia.org/wiki/Multilayer_perceptron"
math |
armstrong_number.cpp | Program to check if a number is an Armstrong/Narcissistic number in decimal system
binary_exponent.cpp | C++ Program to find Binary Exponent Iteratively and Recursively
check_amicable_pair.cpp | A C++ Program to check whether a pair of number is amicable pair or not
check_factorial.cpp | A simple program to check if the given number is a factorial of some number or not
check_prime.cpp | Reduced all possibilities of a number which cannot be prime. Eg: No even number, except 2 can be a prime number, hence we will increment our loop with i+2 jumping on all odd numbers only. If number is <= 1 or if it is even except 2, break the loop and return false telling number is not prime
complex_numbers.cpp | An implementation of Complex Number as Objects
double_factorial.cpp | Compute double factorial: \(n!!\)
eulers_totient_function.cpp | C++ Program to find Euler's Totient function
extended_euclid_algorithm.cpp | GCD using extended Euclid's algorithm
factorial.cpp | C++ program to find factorial of given number
fast_power.cpp | Faster computation for \(a^b\)
fibonacci.cpp | Generate fibonacci sequence
fibonacci_fast.cpp | Faster computation of Fibonacci series
fibonacci_large.cpp | Computes N^th Fibonacci number given as input argument. Uses custom build arbitrary integers library to perform additions and other operations
fibonacci_matrix_exponentiation.cpp | This program computes the N^th Fibonacci number in modulo mod input argument
fibonacci_sum.cpp | An algorithm to calculate the sum of Fibonacci Sequence: \(\mathrm{F}(n) + \mathrm{F}(n+1) + .. + \mathrm{F}(m)\)
gcd_iterative_euclidean.cpp | Compute the greatest common denominator of two integers using iterative form of Euclidean algorithm
gcd_of_n_numbers.cpp | This program aims at calculating the GCD of n numbers by division method
gcd_recursive_euclidean.cpp | Compute the greatest common denominator of two integers using recursive form of Euclidean algorithm
large_factorial.cpp | Compute factorial of any arbitratily large number/
large_number.h | Library to perform arithmatic operations on arbitrarily large numbers
largest_power.cpp | Algorithm to find largest x such that p^x divides n! (factorial) using Legendre's Formula
lcm_sum.cpp | An algorithm to calculate the sum of LCM: \(\mathrm{LCM}(1,n) + \mathrm{LCM}(2,n) + \ldots + \mathrm{LCM}(n,n)\)
least_common_multiple.cpp |
magic_number.cpp | A simple program to check if the given number is a magic number or not. A number is said to be a magic number, if the sum of its digits are calculated till a single digit recursively by adding the sum of the digits after every addition. If the single digit comes out to be 1,then the number is a magic number
miller_rabin.cpp |
modular_division.cpp | An algorithm to divide two numbers under modulo p Modular Division
modular_exponentiation.cpp | C++ Program for Modular Exponentiation Iteratively
modular_inverse_fermat_little_theorem.cpp | C++ Program to find the modular inverse using Fermat's Little Theorem
n_choose_r.cpp | Combinations n choose r function implementation
ncr_modulo_p.cpp | This program aims at calculating nCr modulo p
number_of_positive_divisors.cpp | C++ Program to calculate the number of positive divisors
power_for_huge_numbers.cpp | Compute powers of large numbers
prime_factorization.cpp | Prime factorization of positive integers
prime_numbers.cpp | Get list of prime numbers
primes_up_to_billion.cpp | Compute prime numbers upto 1 billion
realtime_stats.cpp | Compute statistics for data entered in rreal-time
sieve_of_eratosthenes.cpp | Get list of prime numbers using Sieve of Eratosthenes
sqrt_double.cpp | Calculate the square root of any positive real number in \(O(\log N)\) time, with precision fixed using bisection method of root-finding
string_fibonacci.cpp | This Programme returns the Nth fibonacci as a string
sum_of_binomial_coefficient.cpp | Algorithm to find sum of binomial coefficients of a given positive integer
sum_of_digits.cpp | A C++ Program to find the Sum of Digits of input integer
vector_cross_product.cpp | Calculates the Cross Product and the magnitude of two mathematical 3D vectors
numerical_methods |
bisection_method.cpp | Solve the equation \(f(x)=0\) using bisection method
brent_method_extrema.cpp | Find real extrema of a univariate real function in a given interval using Brent's method
durand_kerner_roots.cpp | Compute all possible approximate roots of any given polynomial using Durand Kerner algorithm
false_position.cpp | Solve the equation \(f(x)=0\) using false position method, also known as the Secant method
gaussian_elimination.cpp | Gaussian elimination method
golden_search_extrema.cpp | Find extrema of a univariate real function in a given interval using golden section search algorithm
lu_decompose.cpp | LU decomposition of a square matrix
lu_decomposition.h | Functions associated with LU Decomposition of a square matrix
newton_raphson_method.cpp | Solve the equation \(f(x)=0\) using Newton-Raphson method for both real and complex solutions
ode_forward_euler.cpp | Solve a multivariable first order ordinary differential equation (ODEs) using forward Euler method
ode_midpoint_euler.cpp | Solve a multivariable first order ordinary differential equation (ODEs) using midpoint Euler method
ode_semi_implicit_euler.cpp | Solve a multivariable first order ordinary differential equation (ODEs) using semi implicit Euler method
qr_decompose.h | Library functions to compute QR decomposition of a given matrix
qr_decomposition.cpp | Program to compute the QR decomposition of a given matrix
qr_eigen_values.cpp | Compute real eigen values and eigen vectors of a symmetric matrix using QR decomposition method
rungekutta.cpp | Runge Kutta fourth order method implementation
successive_approximation.cpp | Method of successive approximations using fixed-point iteration method
others |
buzz_number.cpp | A buzz number is a number that is either divisible by 7 or has last digit as 7
decimal_to_binary.cpp | Function to convert decimal number to binary representation
decimal_to_hexadecimal.cpp | Convert decimal number to hexadecimal representation
decimal_to_roman_numeral.cpp | This Programme Converts a given decimal number in the range [0,4000) to both Lower case and Upper case Roman Numeral
fast_integer_input.cpp | Read integers from stdin continuously as they are entered without waiting for the `\n` character
happy_number.cpp | A happy number is a number whose sum of digits is calculated until the sum is a single digit, and this sum turns out to be 1
matrix_exponentiation.cpp | Matrix Exponentiation
palindrome_of_number.cpp | Check if a number is palindrome or not
paranthesis_matching.cpp | Perform paranthesis matching
pascal_triangle.cpp | Pascal's triangle implementation
postfix_evaluation.cpp | Evaluation of Postfix Expression
primality_test.cpp | Primality test implementation
smallest_circle.cpp | Get centre and radius of the smallest circle that circumscribes given set of points
sparse_matrix.cpp |
spiral_print.cpp | Print the elements of a matrix traversing it spirally
stairs_pattern.cpp | This program is use to print the following pattern
tower_of_hanoi.cpp | Solve the Tower of Hanoi problem
vector_important_functions.cpp | A C++ program to demonstrate working of std::sort(), std::reverse()
probability |
addition_rule.cpp | Addition rule of probabilities
bayes_theorem.cpp | Bayes' theorem
binomial_dist.cpp | Binomial distribution example
poisson_dist.cpp | Poisson statistics
range_queries |
fenwick_tree.cpp | Fenwick tree
heavy_light_decomposition.cpp | Heavy Light Decomposition implementation
persistent_seg_tree_lazy_prop.cpp | Persistent segment tree with range updates (lazy propagation)
sparse_table.cpp | Implementation of Sparse Table data structure
search |
binary_search.cpp | Binary search algorithm
exponential_search.cpp | Exponential search algorithm
fibonacci_search.cpp | Fibonacci search algorithm
hash_search.cpp | Hash Search Algorithm - Best Time Complexity Ω(1)
interpolation_search.cpp | Interpolation search algorithm
interpolation_search2.cpp | Interpolation search algorithm
jump_search.cpp | C++ program to implement Jump Search
linear_search.cpp | Linear search algorithm
median_search.cpp | Implementation of Median search algorithm. @cases from here
saddleback_search.cpp | Implementation of Saddleback Algorithm for 2D arrays
ternary_search.cpp | Ternary search algorithm
text_search.cpp | Search for words in a long textual paragraph
sorting |
bogo_sort.cpp | Implementation of Bogosort algorithm
bubble_sort.cpp | Bubble sort algorithm
comb_sort.cpp | Comb Sort Algorithm (Comb Sort)
count_inversions.cpp | Counting Inversions using Merge Sort
cycle_sort.cpp | Implementation of Cycle sort algorithm
gnome_sort.cpp | Implementation of gnome sort algorithm
heap_sort.cpp | Heap Sort Algorithm (heap sort) implementation
insertion_sort.cpp | Insertion Sort Algorithm (Insertion Sort)
merge_insertion_sort.cpp | Algorithm that combines insertion sort and merge sort. Wiki link
merge_sort.cpp | Merege Sort Algorithm (MEREGE SORT) implementation
non_recursive_merge_sort.cpp |
pancake_sort.cpp | Pancake sort sorts a disordered stack of pancakes by flipping any number of pancakes using a spatula using minimum number of flips
pigeonhole_sort.cpp | Implementation of Pigeonhole Sort algorithm
quick_sort.cpp | Quick sort algorithm
quick_sort_3.cpp | Implementation Details
radix_sort2.cpp | Algorithm of Radix sort
shell_sort2.cpp | Shell sort algorithm
strand_sort.cpp | Implementation of Strand Sort algorithm
wiggle_sort.cpp | Wiggle Sort Algorithm Implementation
strings |
brute_force_string_searching.cpp | String pattern search - brute force
horspool.cpp | Horspool's algorithm that finds if a string contains a substring (https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore%E2%80%93Horspool_algorithm)
knuth_morris_pratt.cpp | The Knuth-Morris-Pratt Algorithm for finding a pattern within a piece of text with complexity O(n + m)
rabin_karp.cpp | The Rabin-Karp Algorithm for finding a pattern within a piece of text with complexity O(n + m)