TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
► backtracking | |
generate_parentheses.cpp | Well-formed Generated Parentheses with all combinations |
graph_coloring.cpp | Prints the assigned colors using Graph Coloring algorithm |
knight_tour.cpp | Knight's tour algorithm |
magic_sequence.cpp | |
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 Rat in a Maze algorithm |
subarray_sum.cpp | Subset-sum (only continuous subsets) problem |
subset_sum.cpp | Implementation of the Subset Sum problem |
sudoku_solver.cpp | Sudoku Solver algorithm |
wildcard_matching.cpp | Implementation of the Wildcard Matching problem |
► bit_manipulation | |
count_bits_flip.cpp | Implementation to [Count number of bits to be flipped to convert A to B] (https://www.geeksforgeeks.org/count-number-of-bits-to-be-flipped-to-convert-a-to-b/) in an integer |
count_of_set_bits.cpp | Implementation to [count number of set bits of a number] (https://www.geeksforgeeks.org/count-set-bits-in-an-integer/) in an integer |
count_of_trailing_ciphers_in_factorial_n.cpp | Count the number of ciphers in n! implementation |
find_non_repeating_number.cpp | Implementation to find the non repeating integer in an array of repeating integers. Single Number |
gray_code.cpp | |
hamming_distance.cpp | Returns the Hamming distance between two integers |
next_higher_number_with_same_number_of_set_bits.cpp | [Next higher number with same number of set bits] (https://www.geeksforgeeks.org/next-higher-number-with-same-number-of-set-bits/) implementation |
power_of_2.cpp | [Find whether a given number is power of 2] (https://www.geeksforgeeks.org/program-to-find-whether-a-given-number-is-power-of-2/) implementation |
set_kth_bit.cpp | Implementation to [From the right, set the Kth bit in the binary representation of N] (https://practice.geeksforgeeks.org/problems/set-kth-bit3724/1/) in an integer |
travelling_salesman_using_bit_manipulation.cpp | Implementation to [Travelling Salesman problem using bit-masking] (https://www.geeksforgeeks.org/travelling-salesman-problem-set-1/) |
► ciphers | |
a1z26_cipher.cpp | Implementation of the A1Z26 cipher |
atbash_cipher.cpp | Atbash Cipher implementation |
base64_encoding.cpp | |
caesar_cipher.cpp | Implementation of Caesar cipher algorithm |
elliptic_curve_key_exchange.cpp | Implementation of Elliptic Curve Diffie Hellman Key Exchange |
hill_cipher.cpp | Implementation of Hill cipher algorithm |
morse_code.cpp | Implementation of [Morse Code] (https://en.wikipedia.org/wiki/Morse_code) |
uint128_t.hpp | |
uint256_t.hpp | |
vigenere_cipher.cpp | Implementation of Vigenère cipher algorithm |
xor_cipher.cpp | Implementation of XOR cipher algorithm |
► cpu_scheduling_algorithms | |
fcfs_scheduling.cpp | Implementation of FCFS CPU scheduling algorithm |
non_preemptive_sjf_scheduling.cpp | Implementation of SJF CPU scheduling algorithm |
► data_structures | |
► cll | |
cll.cpp | |
cll.h | |
main_cll.cpp | |
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. Here you can find more information about the algorithm: Scaler - Binary Search tree |
binaryheap.cpp | A C++ program to demonstrate common Binary Heap Operations |
bloom_filter.cpp | Bloom Filter generic implementation in C++ |
circular_queue_using_linked_list.cpp | |
disjoint_set.cpp | Disjoint Sets Data Structure (Disjoint Sets) |
doubly_linked_list.cpp | |
dsu_path_compression.cpp | DSU (Disjoint sets) |
dsu_union_rank.cpp | DSU (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 |
morrisinorder.cpp | |
node.hpp | Provides Node class and related utilities |
queue.hpp | |
queue_using_array.cpp | Implementation of Linear [Queue using array] (https://www.geeksforgeeks.org/array-implementation-of-queue-simple/) |
queue_using_array2.cpp | |
queue_using_linked_list.cpp | |
queue_using_linkedlist.cpp | |
queue_using_two_stacks.cpp | |
rb_tree.cpp | |
reverse_a_linked_list.cpp | Implementation of Reversing a single linked list |
segment_tree.cpp | A data structure to quickly do operations on ranges: the Segment Tree algorithm implementation |
skip_list.cpp | Data structure for fast searching and insertion in \(O(\log n)\) time |
sparse_table.cpp | Implementation of Sparse Table for min() function |
stack.hpp | This class specifies the basic operation on a stack as a linked list |
stack_using_array.cpp | |
stack_using_linked_list.cpp | |
stack_using_queue.cpp | |
test_queue.cpp | |
test_stack.cpp | |
test_stack_students.cpp | |
treap.cpp | A balanced binary search tree (BST) on the basis of binary search tree and heap: the Treap algorithm implementation |
tree.cpp | |
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 |
trie_using_hashmap.cpp | Implementation of Trie data structure using HashMap for different characters and method for predicting words based on prefix |
► divide_and_conquer | |
karatsuba_algorithm_for_fast_multiplication.cpp | Implementation of the Karatsuba algorithm for fast multiplication |
strassen_matrix_multiplication.cpp | |
► dynamic_programming | |
0_1_knapsack.cpp | Implementation of [0-1 Knapsack Problem] (https://en.wikipedia.org/wiki/Knapsack_problem) |
abbreviation.cpp | Implementation of Abbrievation |
armstrong_number_templated.cpp | Checks whether a number is an Armstrong Number or not |
bellman_ford.cpp | |
catalan_numbers.cpp | Provides utilities to compute Catalan numbers using dynamic programming. A Catalan numbers satisfy these recurrence relations: C(0) = C(1) = 1; C(n) = sum(C(i).C(n-i-1)), for i = 0 to n-1 Read more about Catalan numbers here: https://en.wikipedia.org/wiki/Catalan_number https://oeis.org/A000108/ |
coin_change.cpp | |
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 |
edit_distance.cpp | |
egg_dropping_puzzle.cpp | |
fibonacci_bottom_up.cpp | |
floyd_warshall.cpp | |
house_robber.cpp | Implementation of House Robber Problem algorithm |
kadane.cpp | Implementation of Kadane Algorithm |
longest_common_string.cpp | Definition of the function longest_common_string_length |
longest_common_subsequence.cpp | |
longest_increasing_subsequence.cpp | Calculate the length of the longest increasing subsequence in an array |
longest_increasing_subsequence_nlogn.cpp | |
longest_palindromic_subsequence.cpp | Program to find the Longest Palindormic Subsequence of a string |
matrix_chain_multiplication.cpp | |
maximum_circular_subarray.cpp | C++ program for maximum contiguous circular sum problem using Kadane's Algorithm |
minimum_edit_distance.cpp | Implementation of Minimum Edit Distance using Dynamic Programing |
palindrome_partitioning.cpp | Implements Palindrome Partitioning algorithm, giving you the minimum number of partitions you need to make |
partition_problem.cpp | |
searching_of_element_in_dynamic_array.cpp | |
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) |
subset_sum_dynamic.cpp | Implements [Sub-set sum problem] (https://en.wikipedia.org/wiki/Subset_sum_problem) algorithm, which tells whether a subset with target sum exists or not |
trapped_rainwater.cpp | Implementation of the Trapped Rainwater Problem |
tree_height.cpp | |
unbounded_0_1_knapsack.cpp | Implementation of the Unbounded 0/1 Knapsack Problem |
word_break.cpp | Word Break Problem |
► games | |
memory_game.cpp | A simple Memory Game with 3 different sizes and multiple letters |
► geometry | |
graham_scan_algorithm.cpp | |
graham_scan_functions.hpp | |
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] (https://www.coursera.org/learn/algorithms-on-graphs/lecture/7ml18/bidirectional-dijkstra) |
breadth_first_search.cpp | Breadth First Search Algorithm (Breadth First Search) |
bridge_finding_with_tarjan_algorithm.cpp | |
connected_components.cpp | [Graph Connected Components (Connected Components)] (https://en.wikipedia.org/wiki/Component_(graph_theory)) |
connected_components_with_dsu.cpp | Disjoint union |
cycle_check_directed_graph.cpp | |
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 | [Graph Dijkstras Shortest Path Algorithm (Dijkstra's Shortest Path)] (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 |
is_graph_bipartite2.cpp | |
kosaraju.cpp | |
kruskal.cpp | |
lowest_common_ancestor.cpp | Data structure for finding the lowest common ancestor of two vertices in a rooted tree using binary lifting |
max_flow_with_ford_fulkerson_and_edmond_karp_algo.cpp | |
prim.cpp | |
topological_sort.cpp | Topological Sort Algorithm |
topological_sort_by_kahns_algo.cpp | |
travelling_salesman_problem.cpp | [Travelling Salesman Problem] (https://en.wikipedia.org/wiki/Travelling_salesman_problem) implementation |
► graphics | |
spirograph.cpp | Implementation of Spirograph |
► greedy_algorithms | |
binary_addition.cpp | Adds two binary numbers and outputs resulting string |
boruvkas_minimum_spanning_tree.cpp | [Borůvkas Algorithm](https://en.wikipedia.org/wiki/Borůvka's_algorithm) to find the Minimum Spanning Tree |
digit_separation.cpp | Separates digits from numbers in forward and reverse order |
dijkstra_greedy.cpp | Dijkstra algorithm implementation |
gale_shapley.cpp | Gale Shapley Algorithm |
huffman.cpp | |
jump_game.cpp | Jumping Game algorithm implementation |
knapsack.cpp | |
kruskals_minimum_spanning_tree.cpp | Kruskals Minimum Spanning Tree implementation |
prims_minimum_spanning_tree.cpp | |
► 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 |
md5.cpp | Simple C++ implementation of the MD5 Hashing Algorithm |
quadratic_probing_hash_table.cpp | Storage mechanism using quadratic probing hash keys |
sha1.cpp | Simple C++ implementation of the SHA-1 Hashing Algorithm |
sha256.cpp | Simple C++ implementation of the [SHA-256 Hashing Algorithm] (https://en.wikipedia.org/wiki/SHA-2) |
► machine_learning | |
a_star_search.cpp | |
adaline_learning.cpp | Adaptive Linear Neuron (ADALINE) implementation |
k_nearest_neighbors.cpp | Implementation of [K-Nearest Neighbors algorithm] (https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm) |
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] (https://en.wikipedia.org/wiki/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)] (https://en.wikipedia.org/wiki/Multilayer_perceptron) |
► math | |
aliquot_sum.cpp | Program to return the Aliquot Sum of a number |
approximate_pi.cpp | Implementation to calculate an estimate of the number π (Pi) |
area.cpp | Implementations for the area of various shapes |
armstrong_number.cpp | |
binary_exponent.cpp | C++ Program to find Binary Exponent Iteratively and Recursively |
binomial_calculate.cpp | Program to calculate Binomial coefficients |
check_amicable_pair.cpp | A C++ Program to check whether a pair of numbers is an 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 | A simple program to check if the given number is Prime or not |
complex_numbers.cpp | An implementation of Complex Number as Objects |
double_factorial.cpp | Compute double factorial: \(n!!\) |
eratosthenes.cpp | The Sieve of Eratosthenes |
eulers_totient_function.cpp | Implementation of Euler's Totient @description Euler Totient Function is also known as phi function |
extended_euclid_algorithm.cpp | GCD using [extended Euclid's algorithm] (https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm) |
factorial.cpp | Find the factorial of a given number |
fast_power.cpp | Faster computation for \(a^b\) |
fibonacci.cpp | N-th Fibonacci number |
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)\) |
finding_number_of_digits_in_a_number.cpp | [Program to count digits in an integer](https://www.geeksforgeeks.org/program-count-digits-integer-3-different-methods) |
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 |
gcd_recursive_euclidean.cpp | Compute the greatest common denominator of two integers using recursive form of Euclidean algorithm |
integral_approximation.cpp | Compute integral approximation of the function using Riemann sum |
integral_approximation2.cpp | Monte Carlo Integration |
inv_sqrt.cpp | Implementation of the inverse square root Root |
iterative_factorial.cpp | Iterative implementation of Factorial |
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 | |
linear_recurrence_matrix.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 |
modular_inverse_simple.cpp | Simple implementation of modular multiplicative inverse |
n_bonacci.cpp | Implementation of the N-bonacci series |
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 |
perimeter.cpp | Implementations for the perimeter of various shapes |
power_for_huge_numbers.cpp | Compute powers of large numbers |
power_of_two.cpp | Implementation to check whether a number is a power of 2 or not |
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 |
quadratic_equations_complex_numbers.cpp | Calculate quadratic equation with complex roots, i.e. b^2 - 4ac < 0 |
realtime_stats.cpp | Compute statistics for data entered in rreal-time |
sieve_of_eratosthenes.cpp | 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 |
volume.cpp | Implmentations for the volume of various 3D shapes |
► numerical_methods | |
babylonian_method.cpp | A babylonian method (BM) is an algorithm that computes the square root |
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 |
composite_simpson_rule.cpp | Implementation of the Composite Simpson Rule for the approximation |
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 |
fast_fourier_transform.cpp | A fast Fourier transform (FFT) is an algorithm that computes the discrete Fourier transform (DFT) of a sequence, or its inverse (IDFT) |
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 |
gram_schmidt.cpp | Gram Schmidt Orthogonalisation Process |
inverse_fast_fourier_transform.cpp | An inverse fast Fourier transform (IFFT) is an algorithm that computes the inverse fourier transform |
lu_decompose.cpp | LU decomposition of a square matrix |
lu_decomposition.h | Functions associated with LU Decomposition of a square matrix |
midpoint_integral_method.cpp | A numerical method for easy approximation of integrals |
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 |
► operations_on_datastructures | |
array_left_rotation.cpp | Implementation for the Array Left Rotation algorithm |
array_right_rotation.cpp | Implementation for the Array right Rotation algorithm |
circular_linked_list.cpp | Implementation for a Circular Linked List |
circular_queue_using_array.cpp | |
get_size_of_linked_list.cpp | |
inorder_successor_of_bst.cpp | An implementation for finding the Inorder successor of a binary search tree Inorder successor of a node is the next node in Inorder traversal of the Binary Tree. Inorder Successor is NULL for the last node in Inorder traversal |
intersection_of_two_arrays.cpp | Implementation for the Intersection of two sorted Arrays algorithm |
reverse_a_linked_list_using_recusion.cpp | |
reverse_binary_tree.cpp | Implementation for the Reversing a Binary Tree recursively algorithm |
selectionsortlinkedlist.cpp | |
trie_multiple_search.cpp | Trie datastructure with search variants |
union_of_two_arrays.cpp | Implementation for the Union of two sorted Arrays algorithm |
► 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 |
easter.cpp | |
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 |
iterative_tree_traversals.cpp | Iterative version of Preorder, Postorder, and preorder [Traversal of the Tree] (https://en.wikipedia.org/wiki/Tree_traversal) |
kadanes3.cpp | Efficient implementation for maximum contiguous subarray sum by Kadane's algorithm |
kelvin_to_celsius.cpp | Conversion from Kelvin to Celsius degrees |
lfu_cache.cpp | Implementation for [LFU Cache] (https://en.wikipedia.org/wiki/Least_frequently_used) |
longest_substring_without_repeating_characters.cpp | Solution for Longest Substring Without Repeating Characters problem |
lru_cache.cpp | An implementation of LRU Cache. Lru is a part of cache algorithms (also frequently called cache replacement algorithms or cache replacement policies) |
lru_cache2.cpp | Implementation for [LRU Cache] (https://en.wikipedia.org/wiki/Cache_replacement_policies#:~:text=Least%20Recently%20Used%20(LRU)) |
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 |
recursive_tree_traversal.cpp | Recursive version of Inorder, Preorder, and Postorder [Traversal of the Tree] (https://en.wikipedia.org/wiki/Tree_traversal) |
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() |
► physics | |
ground_to_ground_projectile_motion.cpp | Ground to ground projectile motion equation implementations |
► probability | |
addition_rule.cpp | Addition rule of probabilities |
bayes_theorem.cpp | Bayes' theorem |
binomial_dist.cpp | Binomial distribution example |
exponential_dist.cpp | Exponential Distribution |
geometric_dist.cpp | Geometric Distribution |
poisson_dist.cpp | Poisson statistics |
windowed_median.cpp | An implementation of a median calculation of a sliding window along a data stream |
► range_queries | |
fenwick_tree.cpp | Fenwick Tree algorithm implementation |
heavy_light_decomposition.cpp | Heavy Light Decomposition implementation |
mo.cpp | |
persistent_seg_tree_lazy_prop.cpp | Persistent segment tree with range updates (lazy propagation) |
prefix_sum_array.cpp | Prefix Sum Array data structure implementation |
segtree.cpp | Implementation of [Segment Tree] (https://en.wikipedia.org/wiki/Segment_tree) data structure |
sparse_table_range_queries.cpp | |
► scripts | |
file_linter.py | |
► search | |
binary_search.cpp | |
exponential_search.cpp | Exponential search algorithm |
fibonacci_search.cpp | Fibonacci search algorithm |
floyd_cycle_detection_algo.cpp | Implementation of Floyd's Cycle Detection algorithm |
hash_search.cpp | Hash Search Algorithm - Best Time Complexity Ω(1) |
interpolation_search.cpp | |
interpolation_search2.cpp | Interpolation search algorithm |
jump_search.cpp | C++ program to implement Jump Search |
linear_search.cpp | Linear search algorithm |
longest_increasing_subsequence_using_binary_search.cpp | Find the length of the Longest Increasing Subsequence (LIS) using Binary Search |
median_search.cpp | Implementation of Median search algorithm. @cases from here |
median_search2.cpp | Given a linked list L[0,....,n] of n numbers, find the middle node |
saddleback_search.cpp | Implementation of Saddleback Algorithm for 2D arrays |
sublist_search.cpp | Implementation of the Sublist Search Algorithm |
ternary_search.cpp | Ternary search algorithm |
text_search.cpp | Search for words in a long textual paragraph |
► sorting | |
bead_sort.cpp | |
binary_insertion_sort.cpp | Binary Insertion Sort Algorithm (Insertion Sort) |
bitonic_sort.cpp | |
bogo_sort.cpp | Implementation of Bogosort algorithm |
bubble_sort.cpp | Bubble sort algorithm |
bucket_sort.cpp | |
cocktail_selection_sort.cpp | |
comb_sort.cpp | Comb Sort Algorithm (Comb Sort) |
count_inversions.cpp | Counting Inversions using Merge Sort |
counting_sort.cpp | |
counting_sort_string.cpp | |
cycle_sort.cpp | Implementation of Cycle sort algorithm |
dnf_sort.cpp | Implementation of the DNF sort implementation |
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) |
insertion_sort_recursive.cpp | Insertion Sort Algorithm |
library_sort.cpp | |
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 | |
numeric_string_sort.cpp | |
odd_even_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] (https://en.wikipedia.org/wiki/Pigeonhole_sort) |
quick_sort.cpp | Quick sort implementation in C++ |
quick_sort_3.cpp | Implementation Details |
quick_sort_iterative.cpp | Quick Sort without recursion. This method uses the stack instead. Both recursive and iterative implementations have O(n log n) best case and O(n^2) worst case |
radix_sort.cpp | |
radix_sort2.cpp | Algorithm of Radix sort |
random_pivot_quick_sort.cpp | Implementation of the Random Pivot Quick Sort algorithm |
recursive_bubble_sort.cpp | This is an implementation of a recursive version of the Bubble sort algorithm |
selection_sort_iterative.cpp | |
selection_sort_recursive.cpp | Implementation of the Selection sort implementation using recursion |
shell_sort.cpp | |
shell_sort2.cpp | Shell sort algorithm |
slow_sort.cpp | |
stooge_sort.cpp | Stooge sort implementation in C++ |
strand_sort.cpp | Implementation of Strand Sort algorithm |
swap_sort.cpp | |
tim_sort.cpp | |
wave_sort.cpp | Implementation of the Wave sort algorithm |
wiggle_sort.cpp | [Wiggle Sort Algorithm] (https://leetcode.com/problems/wiggle-sort-ii/) Implementation |
► strings | |
boyer_moore.cpp | The Boyer–Moore algorithm searches for occurrences of pattern P in text T by performing explicit character comparisons at different alignments. Instead of a brute-force search of all alignments (of which there are n - m + 1), Boyer–Moore uses information gained by preprocessing P to skip as many alignments as possible |
brute_force_string_searching.cpp | String pattern search - brute force |
duval.cpp | Implementation of Duval's algorithm |
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) |
manacher_algorithm.cpp | Implementation of Manacher's Algorithm |
rabin_karp.cpp | The Rabin-Karp Algorithm for finding a pattern within a piece of text with complexity O(n + m) |
z_function.cpp | The Z function for finding occurences of a pattern within a piece of text with time and space complexity O(n + m) |