Algorithms_in_C++
1.0.0
Set of algorithms implemented in C++.
|
► 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 |
nqueen_print_all_solutions.cpp | Eight Queens puzzle, printing all solutions |
sudoku_solve.cpp | Sudoku Solver algorithm |
► ciphers | |
caesar_cipher.cpp | Implementation of Caesar cipher algorithm |
hill_cipher.cpp | Implementation of Hill cipher algorithm |
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 |
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 | |
queue.h | |
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 |
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 | |
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) |
► geometry | |
jarvis_algorithm.cpp | Implementation of Jarvis’s algorithm |
line_segment_intersection.cpp | Check whether two line segments intersect each other or not |
► graph | |
breadth_first_search.cpp | Breadth First Search Algorithm (Breadth First Search) |
connected_components.cpp | Graph Connected Components (Connected Components) |
depth_first_search.cpp | Depth First Search Algorithm (Depth First Search) |
dijkstra.cpp | Graph Dijkstras Shortest Path Algorithm (Dijkstra's Shortest Path) |
hamiltons_cycle.cpp | The implementation of Hamilton's cycle dynamic solution for vertices number less than 20 |
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 |
► 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 |
► 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 NeuralNetwork (aka 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_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 |
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 |
least_common_multiple.cpp | |
miller_rabin.cpp | |
modular_inverse_fermat_little_theorem.cpp | C++ Program to find the modular inverse using Fermat's Little Theorem |
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_digits.cpp | A C++ Program to find the Sum of Digits of input integer |
► 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 |
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 |
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 |
► 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 |
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) |
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 | |
pigeonhole_sort.cpp | Implementation of Pigeonhole Sort algorithm |
quick_sort.cpp | Quick sort algorithm |
quick_sort_3.cpp | Implementation Details |
shell_sort2.cpp | Shell sort algorithm |
► 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) |