Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/C-Plus-Plus
/ functions
Functions
2,100 in github.com/TheAlgorithms/C-Plus-Plus
⨍
Functions
2,100
◇
Types & classes
164
↓ 1 callers
Function
mergeSort
* Merge sort is a divide and conquer algorithm, it divides the * input array into two halves and calls itself for the two halves * and then calls me
sorting/merge_sort.cpp:82
↓ 1 callers
Function
mergeSort
sorting/count_inversions.cpp:132
↓ 1 callers
Function
method1
* This method converts the bit representation and stores it as a decimal * number. */
others/decimal_to_binary.cpp:11
↓ 1 callers
Function
method2
* This method stores each bit value from LSB to MSB and then prints them back * from MSB to LSB */
others/decimal_to_binary.cpp:27
↓ 1 callers
Function
midpoint_euler
* @brief Compute approximation using the midpoint-Euler * method in the given limits. * @param[in] dx step size * @param[in] x0 initial va
numerical_methods/ode_midpoint_euler.cpp:107
↓ 1 callers
Function
midpoint_euler_step
\addtogroup ode Ordinary Differential Equations * @{ */ * @brief Compute next step approximation using the midpoint-Euler * method. * @f[y_{n+1} =
numerical_methods/ode_midpoint_euler.cpp:85
↓ 1 callers
Function
miller_test
math/miller_rabin.cpp:73
↓ 1 callers
Function
min
* @brief Takes input of the cost of * three operations: Insert, Replace and Delete * and return the minimum cost among them. * @param x used to
dynamic_programming/minimum_edit_distance.cpp:68
↓ 1 callers
Function
minSwaps
Function returns the minimum number of swaps required to sort the array
sorting/swap_sort.cpp:9
↓ 1 callers
Function
minValue
* @param root of the tree * @returns node with minimum value in the tree */
data_structures/avltree.cpp:79
↓ 1 callers
Function
mincoins
dynamic_programming/coin_change_topdown.cpp:47
↓ 1 callers
Function
minimax
backtracking/minimax.cpp:39
↓ 1 callers
Function
minimum_distance
* @brief Utility function that finds * the vertex with the minimum distance in `mdist`. * * @param mdist array of distances to each vertex * @para
greedy_algorithms/dijkstra_greedy.cpp:82
↓ 1 callers
Function
minmax_scaler
machine_learning/vector_ops.hpp:269
↓ 1 callers
Function
modInverse
Find modular inverse of a modulo m i.e. a number x such that (a*x)%m = 1 * * @param[in] a the number for which the modular inverse is queried * @pa
math/ncr_modulo_p.cpp:66
↓ 1 callers
Function
modular_exponentiation
math/miller_rabin.cpp:43
↓ 1 callers
Function
morrisInorder
data_structures/morrisinorder.cpp:52
↓ 1 callers
Function
morse_to_char
* Get character from the morse representation. * @param s Morse representation * @returns corresponding character */
ciphers/morse_code.cpp:118
↓ 1 callers
Function
multiply
This function multiplies x * with the number represented by res[]. * res_size is size of res[] or * number of digits in the number * represented b
math/power_for_huge_numbers.cpp:25
↓ 1 callers
Method
multiply
math/large_number.h:258
↓ 1 callers
Function
my_selection_sort_linked_list
performing selection sort on the linked list in an iterative manner
operations_on_datastructures/selectionsortlinkedlist.cpp:47
↓ 1 callers
Function
n_polygon_surface_perimeter
math/perimeter.cpp:99
↓ 1 callers
Function
nextToTop
* @brief A utility function to find next to top in a stack. * @param S Stack to be used for the process. * @returns @param Point Co-ordinates of the
geometry/graham_scan_functions.hpp:78
↓ 1 callers
Function
no_occurence_tests
* @brief random tests for checking performance when an array doesn't contain an element */
search/fibonacci_search.cpp:72
↓ 1 callers
Function
no_of_connected_components
* @brief Find total no. of connected components * @return Number of connected components */
graph/connected_components_with_dsu.cpp:85
↓ 1 callers
Function
non_recursive_merge_sort
sorting/non_recursive_merge_sort.cpp:25
↓ 1 callers
Function
number_of_digits
* @brief Function to calculate the total number of digits in the number. * @param num Number * @return Total number of digits. */
math/armstrong_number.cpp:28
↓ 1 callers
Function
oddEven
sorting/odd_even_sort.cpp:7
↓ 1 callers
Function
ols_test
Self test checks */
machine_learning/ordinary_least_squares_regressor.cpp:369
↓ 1 callers
Function
opening
return opening paranthesis corresponding to the close paranthesis * @param[in] ch closed paranthesis character */
others/paranthesis_matching.cpp:36
↓ 1 callers
Function
pal_part
* Function implementing palindrome partitioning algorithm using lookup table * method. * @param str input string * @returns minimum number of parti
dynamic_programming/palindrome_partitioning.cpp:45
↓ 1 callers
Function
parallelogram_area
math/area.cpp:75
↓ 1 callers
Function
parallelogram_perimeter
math/perimeter.cpp:75
↓ 1 callers
Function
partition
greedy_algorithms/knapsack.cpp:11
↓ 1 callers
Function
partition
* @brief The partition function sorts the array from * start to end and uses the last element as the pivot. * @param arr the array to be sorted * @
sorting/quick_sort_iterative.cpp:33
↓ 1 callers
Function
partition
sorting/random_pivot_quick_sort.cpp:103
↓ 1 callers
Function
pascal_triangle
* Print the triangle * \param [in,out] arr array containing Pascal numbers * \param [in] n depth of Pascal triangle to print * \result arr poin
others/pascal_triangle.cpp:36
↓ 1 callers
Function
pat_test
* @brief A test case in which we search for every appearance of the word 'pat' * @param text The text in which we search for appearance of the word
strings/boyer_moore.cpp:235
↓ 1 callers
Function
poisson_expected
* calculate the expected value over a time * e.g rate of 2.5 over 10 mins = 2.5 x 10 = 25 */
probability/poisson_dist.cpp:25
↓ 1 callers
Function
poisson_range_successes
* probability of a success in range for Poisson dist (inclusive, inclusive) * \f[P = \sum_i p(\mu,i)\f] */
probability/poisson_dist.cpp:54
↓ 1 callers
Function
poisson_rate
* poisson rate:\n * calculate the events per unit time\n * e.g 5 dollars every 2 mins = 5 / 2 = 2.5 */
probability/poisson_dist.cpp:17
↓ 1 callers
Function
poly_function
* Evaluate the value of a polynomial with given coefficients * \param[in] coeffs coefficients of the polynomial * \param[in] x point at which to eva
numerical_methods/durand_kerner_roots.cpp:54
↓ 1 callers
Function
pop
data_structures/stack_using_linked_list.cpp:17
↓ 1 callers
Function
pop_front
machine_learning/vector_ops.hpp:102
↓ 1 callers
Function
power
computing integer power of a matrix using recursive multiplication. * @note A must be a square matrix for this algorithm. * \param [in] A base matri
others/matrix_exponentiation.cpp:76
↓ 1 callers
Function
power
* @brief This function calculates a raised to exponent b under modulo c using * modular exponentiation. * @param a integer base * @param b unsigned
math/modular_division.cpp:50
↓ 1 callers
Function
power
* Function to compute A^n where A is a matrix. * @param T matrix * @param ex power * @returns resultant matrix */
math/fibonacci_sum.cpp:58
↓ 1 callers
Function
power
This function finds power of a number x and print \f$x^n\f$ * @param x base * @param n exponent */
math/power_for_huge_numbers.cpp:56
↓ 1 callers
Function
prim
graph/prim.cpp:8
↓ 1 callers
Function
prime_factorization
Prime factorization of a number */
math/prime_factorization.cpp:40
↓ 1 callers
Function
primes
Generate an increasingly large number of primes * and store in a list */
math/prime_numbers.cpp:12
↓ 1 callers
Function
print
* @brief Utility function to print the distances to vertices. * * This function prints the distances to each vertex in a tabular format. If the * d
greedy_algorithms/dijkstra_greedy.cpp:104
↓ 1 callers
Function
print
< Definition of the sequence type * @brief Print the magic sequence * @param s working memory for the sequence */
backtracking/magic_sequence.cpp:42
↓ 1 callers
Function
print
Utility function to print distances
dynamic_programming/floyd_warshall.cpp:41
↓ 1 callers
Function
print
Utility function to print distances
dynamic_programming/bellman_ford.cpp:40
↓ 1 callers
Function
printCodes
Prints huffman codes from the root of Huffman Tree.
greedy_algorithms/huffman.cpp:45
↓ 1 callers
Method
print_flow_info
graph/max_flow_with_ford_fulkerson_and_edmond_karp_algo.cpp:80
↓ 1 callers
Function
print_primes
* @brief Prints all the indexes of true values in the passed std::vector * @param primes The vector that has been passed through `sieve(...)` * @ret
math/eratosthenes.cpp:51
↓ 1 callers
Function
problem
* @brief Problem statement for a system with first-order differential * equations. Updates the system differential variables. * \note This function
numerical_methods/ode_forward_euler.cpp:54
↓ 1 callers
Function
projection
* Projection Function * Takes input of 2 vectors along with their dimension and evaluates their * projection in temp * * @param x Vector 1 * @par
numerical_methods/gram_schmidt.cpp:79
↓ 1 callers
Function
push
data_structures/stack_using_linked_list.cpp:10
↓ 1 callers
Method
push_front
* @brief push the node to the front of the linked list. * @param node_ptr the node to be pushed */
others/lru_cache2.cpp:83
↓ 1 callers
Function
push_vertex
* //Recursive function/method to push vertices into stack passed as parameter: * @param v vertices * @param st stack passed by reference * @param v
graph/kosaraju.cpp:37
↓ 1 callers
Function
putProber
Finds empty spot * @param entry Instance of table entry * @param key key value to search/probe * @returns `true` if key is present * @returns `fal
hashing/quadratic_probing_hash_table.cpp:106
↓ 1 callers
Function
putProber
Finds empty spot in a vector * @param entry vector to search in * @param key key to search for * @returns `true` if key is not present or is a `tou
hashing/double_hash_hash_table.cpp:120
↓ 1 callers
Function
putProber
Finds empty spot * @param entry instance to check in * @param key key value to hash * @return hash value of the key */
hashing/linear_probing_hash_table.cpp:98
↓ 1 callers
Function
pyramid_volume
math/volume.cpp:80
↓ 1 callers
Function
queue_test
* Testing function */
data_structures/queue_using_two_stacks.cpp:101
↓ 1 callers
Function
quickSort
greedy_algorithms/knapsack.cpp:31
↓ 1 callers
Function
radixsort
sorting/radix_sort.cpp:6
↓ 1 callers
Function
random_tests
* @brief random tests which cover cases when we have one, multiple or zero occurences of the value we're looking for */
search/fibonacci_search.cpp:96
↓ 1 callers
Function
rec_ternary_search
* This is the recursive method of the ternary search which returns the index of * the element. * \param[in] left lower interval limit * \param[in]
search/ternary_search.cpp:90
↓ 1 callers
Function
recalculate_hash
* re-hash a string using known existing hash * \param[in] s source of string to hash * \param[in] old_index previous index of string * \param[in] n
strings/rabin_karp.cpp:42
↓ 1 callers
Function
rect_prism_volume
math/volume.cpp:41
↓ 1 callers
Function
regula_falsi
* @brief This function finds root of the equation in given interval i.e. (x1,x2). * @param x1,x2 values for an interval in which root is present. @p
numerical_methods/false_position.cpp:55
↓ 1 callers
Function
rehash
Rehashes the table into a bigger table * @returns none */
hashing/quadratic_probing_hash_table.cpp:160
↓ 1 callers
Function
rehash
Rehashes the table into a bigger table * @returns None */
hashing/double_hash_hash_table.cpp:161
↓ 1 callers
Function
rehash
Rehashes the table into a bigger table * @returns None */
hashing/linear_probing_hash_table.cpp:138
↓ 1 callers
Function
removalInfo
Information about removal process * @param key key value to hash and remove from table */
hashing/quadratic_probing_hash_table.cpp:222
↓ 1 callers
Function
removalInfo
Information about removal process * @param key key value to remove from table */
hashing/double_hash_hash_table.cpp:227
↓ 1 callers
Function
removalInfo
Information about removal process * @param key key value to hash and remove */
hashing/linear_probing_hash_table.cpp:201
↓ 1 callers
Function
remove
Removes key. Leaves tombstone upon removal. * @param key key value to hash and remove from table */
hashing/quadratic_probing_hash_table.cpp:194
↓ 1 callers
Function
remove
Removes key. Leaves tombstone upon removal. * @param key key value to remove */
hashing/double_hash_hash_table.cpp:199
↓ 1 callers
Function
remove
Removes key. Leaves tombstone upon removal. * @param key key value to hash and remove */
hashing/linear_probing_hash_table.cpp:173
↓ 1 callers
Method
remove
data_structures/doubly_linked_list.cpp:41
↓ 1 callers
Method
removeWord
Function to remove the word which calls the helper function.
data_structures/trie_modern.cpp:148
↓ 1 callers
Method
reverseList
* @brief Utility function for reversing a list * @brief Using the current, previous, and next pointer. * @returns void */
data_structures/reverse_a_linked_list.cpp:125
↓ 1 callers
Method
reverseShow
data_structures/doubly_linked_list.cpp:89
↓ 1 callers
Function
reverse_binary
math/miller_rabin.cpp:19
↓ 1 callers
Method
runTests
* @brief Executes test cases * @returns void * */
search/sublist_search.cpp:186
↓ 1 callers
Method
runTests
* @brief Executes test cases * @returns void * */
sorting/random_pivot_quick_sort.cpp:199
↓ 1 callers
Method
runTests
* @brief Executes test cases * @returns void * */
operations_on_datastructures/inorder_successor_of_bst.cpp:243
↓ 1 callers
Function
run_tests
* @brief A function to invoke all test cases * @returns void * */
others/lru_cache.cpp:239
↓ 1 callers
Function
save_exact_solution
* Function to compute and save exact solution for comparison * * \param [in] X0 initial value of independent variable * \param [in] X_M
numerical_methods/ode_midpoint_euler.cpp:156
↓ 1 callers
Function
save_exact_solution
* Function to compute and save exact solution for comparison * * \param [in] X0 initial value of independent variable * \param [in] X_M
numerical_methods/ode_forward_euler.cpp:153
↓ 1 callers
Function
save_exact_solution
* Function to compute and save exact solution for comparison * * \param [in] X0 initial value of independent variable * \param [in] X_M
numerical_methods/ode_semi_implicit_euler.cpp:153
↓ 1 callers
Method
scheduleForFcfs
* @brief Algorithm for scheduling CPU processes according to the First Come * First Serve(FCFS) scheduling algorithm. * * @details FCFS
cpu_scheduling_algorithms/fcfs_scheduling.cpp:155
↓ 1 callers
Method
scheduleForSJF
cpu_scheduling_algorithms/non_preemptive_sjf_scheduling.cpp:154
↓ 1 callers
Method
search
data_structures/rb_tree.cpp:421
↓ 1 callers
Method
search
* function searchs for @param find_elem in the list * @param find_elem to be searched for in the list */
data_structures/linked_list.cpp:197
← previous
next →
801–900 of 2,100, ranked by callers