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
↓ 2 callers
Function
mov
Move one disc from one tower to another * \param [in,out] From tower to move disk *from* * \param [in,out] To tower to move disk *to* */
others/tower_of_hanoi.cpp:39
↓ 2 callers
Function
multiply
To multiply 2 matrices * \param [in] A matrix 1 of size (m\f$\times\f$n) * \param [in] B \p matrix 2 of size (p\f$\times\f$q)\n\note \f$p=n\f$ * \r
others/matrix_exponentiation.cpp:57
↓ 2 callers
Function
multiply
* Function to multiply two matrices * @param T matrix 1 * @param A martix 2 * @returns resultant matrix */
math/fibonacci_sum.cpp:39
↓ 2 callers
Function
nCr
Computes n choose r * \param [in] n * \param [in] r * \returns \f$\displaystyle {n\choose r} = * \frac{n!}{r!(n-r)!} = \frac{n\times(n-1)\times(n-
probability/binomial_dist.cpp:47
↓ 2 callers
Method
ncr
* @brief computes nCr % p * @param[in] n the number of objects to be chosen * @param[in] r the number of objects to choose from * @retu
math/ncr_modulo_p.cpp:116
↓ 2 callers
Function
otherHashFxn
* @brief Used for second hash function * * @param key key value to hash * @return hash value of the key */
hashing/double_hash_hash_table.cpp:58
↓ 2 callers
Function
partition
sorting/quick_sort.cpp:70
↓ 2 callers
Function
partition3
sorting/quick_sort_3.cpp:56
↓ 2 callers
Function
poisson_x_successes
* Find the probability of x successes in a Poisson dist. * \f[p(\mu,x) = \frac{\mu^x e^{-\mu}}{x!}\f] */
probability/poisson_dist.cpp:46
↓ 2 callers
Function
pop
pop a byte out of stack variable
others/paranthesis_matching.cpp:29
↓ 2 callers
Function
pop_back
machine_learning/vector_ops.hpp:119
↓ 2 callers
Method
postOrderIterative
* @brief postOrderIterative() function that will perform the postorder * traversal iteratively, and return the result array that contain the postord
others/iterative_tree_traversals.cpp:132
↓ 2 callers
Method
preOrderIterative
* @brief preOrderIterative() function that will perform the preorder traversal * iteratively, and return the result array that contain the preorder
others/iterative_tree_traversals.cpp:102
↓ 2 callers
Function
print
printing the linked list
operations_on_datastructures/selectionsortlinkedlist.cpp:16
↓ 2 callers
Function
printArray
utility function to print the Array
sorting/tim_sort.cpp:89
↓ 2 callers
Function
printLinkedList
* @brief A simple function to print the linked list * @param start The head of the linked list * @returns void */
search/sublist_search.cpp:58
↓ 2 callers
Method
printResult
cpu_scheduling_algorithms/non_preemptive_sjf_scheduling.cpp:197
↓ 2 callers
Function
printRoot
* @brief This function prints roots of the equation. * @param root which we have to print. * @param count which is count of the root in an interval
numerical_methods/false_position.cpp:84
↓ 2 callers
Function
print_table
games/memory_game.cpp:123
↓ 2 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_midpoint_euler.cpp:53
↓ 2 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_semi_implicit_euler.cpp:53
↓ 2 callers
Function
push_all_to_vector
data_structures/node.hpp:37
↓ 2 callers
Function
qr_decompose
numerical_methods/qr_decompose.h:146
↓ 2 callers
Function
quicksort
sorting/quick_sort_3.cpp:94
↓ 2 callers
Function
radix
* @brief Function to sort vector digit by digit. * @param ar - vector to be sorted * @returns sorted vector */
sorting/radix_sort2.cpp:82
↓ 2 callers
Method
range_comb
* @brief Helper method for range_comb method below * @param i The current node * @param l The leftmost node of the current node * @p
data_structures/segment_tree.cpp:80
↓ 2 callers
Function
rect_area
math/area.cpp:40
↓ 2 callers
Function
rect_perimeter
math/perimeter.cpp:40
↓ 2 callers
Function
recursive_bubble_sort
sorting/recursive_bubble_sort.cpp:83
↓ 2 callers
Function
result
* Function to compute sum of fibonacci sequence from 0 to n. * @param n number * @returns uint64_t ans, the sum of sequence */
math/fibonacci_sum.cpp:77
↓ 2 callers
Function
reverse_str
* @brief reverses a given string * @param in_str input string * @return the string in which the characters appear in the reversed order as in * in_
dynamic_programming/longest_common_string.cpp:119
↓ 2 callers
Function
rightRotate
* @param root of the tree to be rotated * @return node after right rotation */
data_structures/avltree.cpp:55
↓ 2 callers
Function
scs
* Function implementing Shortest Common Super-Sequence algorithm using look-up table method. * @param str1 first string 'X' * @param
dynamic_programming/shortest_common_supersequence.cpp:42
↓ 2 callers
Function
sgn
numerical_methods/bisection_method.cpp:32
↓ 2 callers
Method
show
* @brief Utility function to print array * @returns void */
data_structures/list_array.cpp:203
↓ 2 callers
Function
showArray
sorting/random_pivot_quick_sort.cpp:73
↓ 2 callers
Function
show_data
sorting/shell_sort2.cpp:18
↓ 2 callers
Function
shuffle
sorting/bogo_sort.cpp:37
↓ 2 callers
Function
sieve
* @brief Performs the sieve * @param vec Array of bools, all initialised to true, where the number of * elements is the highest number we wish to ch
math/eratosthenes.cpp:33
↓ 2 callers
Method
size
* @brief Utility function to return the current size of the stack * @returns current size of stack */
data_structures/stack_using_queue.cpp:74
↓ 2 callers
Method
size
* @brief A utility function that returns the size of the set to which i * belongs to * @param i element of some set * @returns size of
data_structures/dsu_path_compression.cpp:149
↓ 2 callers
Method
sort
* @brief Sort the list * @returns void */
data_structures/list_array.cpp:121
↓ 2 callers
Function
spirograph
graphics/spirograph.cpp:70
↓ 2 callers
Function
square_area
math/area.cpp:29
↓ 2 callers
Function
square_perimeter
math/perimeter.cpp:28
↓ 2 callers
Function
sum_of_digits
* Function to find the sum of the digits of an integer. * @param num The integer. * @return Sum of the digits of the integer. * * \detail * First
math/sum_of_digits.cpp:23
↓ 2 callers
Function
sum_of_divisor
* @brief Function to calculate the sum of all the proper divisor * of an integer. * @param num selected number. * @return Sum of the proper divisor
math/check_amicable_pair.cpp:31
↓ 2 callers
Function
test_findGraphSum
* @brief counts the sum of edges in the given tree * @param adj 2D vector adjacency matrix * @returns the int size of the tree */
greedy_algorithms/boruvkas_minimum_spanning_tree.cpp:175
↓ 2 callers
Function
timSort
iterative Timsort function to sort the array[0...n-1] (similar to merge sort)
sorting/tim_sort.cpp:65
↓ 2 callers
Function
transpose
machine_learning/vector_ops.hpp:382
↓ 2 callers
Function
traverse
data_structures/node.hpp:23
↓ 2 callers
Method
traverse
data_structures/circular_queue_using_linked_list.cpp:57
↓ 2 callers
Method
update
* @brief Doing range update, checking at every node if it has some value to * be propagated. All nodes affected by the update are copied and
range_queries/persistent_seg_tree_lazy_prop.cpp:136
↓ 1 callers
Function
BFT
data_structures/binary_search_tree.cpp:92
↓ 1 callers
Function
BFT
data_structures/tree.cpp:33
↓ 1 callers
Function
BellmanFord
The main function that finds the shortest path from given source to all other vertices using Bellman-Ford.It also detects negative weight cycle
dynamic_programming/bellman_ford.cpp:53
↓ 1 callers
Function
CanIMove
backtracking/nqueen_print_all_solutions.cpp:51
↓ 1 callers
Function
CocktailSelectionSort_v2
sorting/cocktail_selection_sort.cpp:43
↓ 1 callers
Function
Counting_Sort
sorting/counting_sort.cpp:24
↓ 1 callers
Function
CreateSet
* * Function to create a set * @param n number of element * */
data_structures/disjoint_set.cpp:37
↓ 1 callers
Method
Delete
* @brief Function to verify presence and hence delete an entry from the trie * @param entry string entry to be deleted from the trie */
operations_on_datastructures/trie_multiple_search.cpp:153
↓ 1 callers
Function
Deque
data_structures/queue_using_linked_list.cpp:29
↓ 1 callers
Function
Deque
data_structures/queue_using_array2.cpp:15
↓ 1 callers
Function
Deque
operations_on_datastructures/circular_queue_using_array.cpp:20
↓ 1 callers
Function
Enque
data_structures/queue_using_linked_list.cpp:11
↓ 1 callers
Function
Enque
data_structures/queue_using_array2.cpp:7
↓ 1 callers
Function
Enque
operations_on_datastructures/circular_queue_using_array.cpp:10
↓ 1 callers
Function
FindNextGap
* * Find the next gap by shrinking the current gap by shrink factor of 1.3 * @param gap current gap * @return new gap * */
sorting/comb_sort.cpp:29
↓ 1 callers
Function
FloydWarshall
The main function that finds the shortest path from a vertex to all other vertices using Floyd-Warshall Algorithm.
dynamic_programming/floyd_warshall.cpp:57
↓ 1 callers
Function
HuffmanCodes
The main function that builds a Huffman Tree and print codes by traversing the built Huffman Tree
greedy_algorithms/huffman.cpp:58
↓ 1 callers
Function
In
data_structures/binary_search_tree.cpp:109
↓ 1 callers
Function
In
data_structures/tree.cpp:58
↓ 1 callers
Function
Insert
* @brief Inserts the given data in BST while maintaining the properties of BST. * @param root Pointer to the root node of the BST * @param data Data
operations_on_datastructures/inorder_successor_of_bst.cpp:82
↓ 1 callers
Method
Insert
* @brief Function to insert a word in the trie * @param entry string entry to be inserted in the trie */
operations_on_datastructures/trie_multiple_search.cpp:107
↓ 1 callers
Method
InsertItem
* @brief Insert item to the proper position of the node and return the * position index. * * This is a helper function we use during in
data_structures/tree_234.cpp:163
↓ 1 callers
Function
InterpolationSearch
function to search the value in an array using interpolation search * \param [in] arr array to search in * \param [in] value value to search for
search/interpolation_search2.cpp:15
↓ 1 callers
Function
IsPrime
Check if a number is prime * \param[in] number number to check * \returns true if prime else false */
others/primality_test.cpp:18
↓ 1 callers
Function
KnapSackFilling
* @brief Recursive function to calculate the maximum value obtainable using * an unbounded knapsack approach. * * @param i Current index in
dynamic_programming/unbounded_0_1_knapsack.cpp:58
↓ 1 callers
Function
LIS
dynamic_programming/longest_increasing_subsequence_nlogn.cpp:10
↓ 1 callers
Function
MatrixChainMultiplication
Function to find the most efficient way to multiply the given sequence of matrices
dynamic_programming/matrix_chain_multiplication.cpp:12
↓ 1 callers
Function
Max
sorting/counting_sort.cpp:4
↓ 1 callers
Function
Min
sorting/counting_sort.cpp:12
↓ 1 callers
Function
NQueenSol
backtracking/nqueen_print_all_solutions.cpp:81
↓ 1 callers
Function
N_bonacci
* @brief Finds the N-Bonacci series for the `n` parameter value and `m` * parameter terms * @param n is in the N-Bonacci series * @param m is the n
math/n_bonacci.cpp:40
↓ 1 callers
Function
Post
data_structures/binary_search_tree.cpp:117
↓ 1 callers
Function
Post
data_structures/tree.cpp:66
↓ 1 callers
Function
Pre
data_structures/binary_search_tree.cpp:101
↓ 1 callers
Function
Pre
data_structures/tree.cpp:50
↓ 1 callers
Function
Print
dynamic_programming/longest_common_subsequence.cpp:6
↓ 1 callers
Function
PrintSol
backtracking/nqueen_print_all_solutions.cpp:31
↓ 1 callers
Function
Remove
data_structures/binary_search_tree.cpp:60
↓ 1 callers
Method
Remove
* @brief Remove item from tree * @param item item to remove * @return true if item found and removed, false otherwise */
data_structures/tree_234.cpp:929
↓ 1 callers
Method
SearchFreqSuggestions
* @brief Lists out the most frequent words in trie with the * longest prefix of the search key that is present in the trie. For example - * if tri
operations_on_datastructures/trie_multiple_search.cpp:368
↓ 1 callers
Function
Sieve
Perform Sieve algorithm */
math/primes_up_to_billion.cpp:13
↓ 1 callers
Function
SieveOfEratosthenes
Calculating prime number upto a given range */
math/prime_factorization.cpp:23
↓ 1 callers
Function
SlowSort
sorting/slow_sort.cpp:13
↓ 1 callers
Function
Sqrt
Bisection method implemented for the function \f$x^2-a=0\f$ * whose roots are \f$\pm\sqrt{a}\f$ and only the positive root is returned. */
math/sqrt_double.cpp:16
↓ 1 callers
Function
TH
* Recursive algorithm to solve the puzzle * \param [in] n starting number of disks * \param [in,out] From tower to move disks from * \param [in,ou
others/tower_of_hanoi.cpp:52
↓ 1 callers
Method
Traverse
* @brief In-order traverse the tree, print items * @param tree tree to traverse */
data_structures/tree_234.cpp:562
↓ 1 callers
Function
TriangleArea
* Compute the area of triangle formed by three points using [Heron's * formula](https://en.wikipedia.org/wiki/Heron%27s_formula). * If the lengths o
others/smallest_circle.cpp:54
← previous
next →
501–600 of 2,100, ranked by callers