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
Method
GetMinItem
* @brief get min item (leftmost) in the current node * @return min item */
data_structures/tree_234.cpp:126
↓ 2 callers
Method
GetRightmostChild
* @brief Get rightmose child of the current node * @return the rightmost child */
data_structures/tree_234.cpp:265
↓ 2 callers
Function
InSameUnion
* * A utility function to check if x and y are from same set or not * @param x element of some set * @param y element of some set * */
data_structures/disjoint_set.cpp:67
↓ 2 callers
Method
Insert
* @brief Insert item to tree * @param item item to insert */
data_structures/tree_234.cpp:655
↓ 2 callers
Method
InsertItemByIndex
* @brief Insert a value to the index position * @param index index where to insert item * @param item value to insert * @param with_ch
data_structures/tree_234.cpp:189
↓ 2 callers
Function
InsertionSort
sorting/merge_insertion_sort.cpp:37
↓ 2 callers
Function
InverseFastFourierTransform
* @brief InverseFastFourierTransform is a recursive function which returns list * of complex numbers * @param p List of Coefficents in form of compl
numerical_methods/inverse_fast_fourier_transform.cpp:34
↓ 2 callers
Method
IsLeaf
* @brief Check if node is a leaf * @return true if node is leaf, false otherwise */
data_structures/tree_234.cpp:67
↓ 2 callers
Function
LIS
* @brief Calculate the longest increasing subsequence for the specified numbers * @param a the array used to calculate the longest increasing subsequ
dynamic_programming/longest_increasing_subsequence.cpp:40
↓ 2 callers
Function
NQueenSol
backtracking/n_queens_all_solution_optimised.cpp:89
↓ 2 callers
Function
PointInCircle
* Check if a set of points lie within given circle. This is true if the * distance of all the points from the centre of the circle is less than the
others/smallest_circle.cpp:72
↓ 2 callers
Function
Print
sorting/counting_sort.cpp:20
↓ 2 callers
Method
Print
* @brief Print tree into a dot file * @param file_name output file name, if nullptr then use "out.dot" as default */
data_structures/tree_234.cpp:1131
↓ 2 callers
Function
SLEEP
games/memory_game.cpp:29
↓ 2 callers
Method
SetCount
* @brief Set the item count of the node * * This is only used when we spliting and merging node where we need to do * some raw operatio
data_structures/tree_234.cpp:61
↓ 2 callers
Function
Shortest_Path_Distance
* @brief This function returns the shortest distance from the source * to the target if there is path between vertices 's' and 't'. * * @param work
graph/bidirectional_dijkstra.cpp:62
↓ 2 callers
Function
Standard_InvSqrt
math/inv_sqrt.cpp:59
↓ 2 callers
Method
__detailed_single_prediction
* Private function to get detailed predictions (i.e. * activated neuron values). This function is used in * backpropagation, single predict
machine_learning/neural_network.cpp:288
↓ 2 callers
Function
add
range_queries/mo.cpp:14
↓ 2 callers
Function
add
Checks for load factor here * @param key key value to hash and add to table */
hashing/quadratic_probing_hash_table.cpp:182
↓ 2 callers
Function
add
Checks for load factor here * @param key key value to add to the table */
hashing/double_hash_hash_table.cpp:185
↓ 2 callers
Function
add
Adds entry using linear probing. Checks for load factor here * @param key key value to hash and add */
hashing/linear_probing_hash_table.cpp:161
↓ 2 callers
Method
add_digit
* add a digit at MSB to the large number **/
math/large_number.h:118
↓ 2 callers
Function
add_strings
* @brief Binary addition * @param first, the input string 1 * @param second, the input string 2 * @returns the sum binary string */
divide_and_conquer/karatsuba_algorithm_for_fast_multiplication.cpp:36
↓ 2 callers
Function
addition
* @brief Addition of points * @details Add given point to generate third point. More description can be * found * [here](https://en.wikipedia.org/w
ciphers/elliptic_curve_key_exchange.cpp:110
↓ 2 callers
Function
approximate_pi
* @brief This function uses the points in a given vector 'pts' (drawn at * random) to return an approximation of the number π. * @param pts Each ite
math/approximate_pi.cpp:47
↓ 2 callers
Function
assertArray
* @brief Asserts an array of complex numbers. * @param input Input array of complex numbers. . * @param expected Expected array of complex numbers.
math/quadratic_equations_complex_numbers.cpp:100
↓ 2 callers
Function
atbash_cipher
* @brief atbash cipher encryption and decryption * @param text Plaintext to be encrypted * @returns encoded or decoded string */
ciphers/atbash_cipher.cpp:47
↓ 2 callers
Function
babylonian_method
numerical_methods/babylonian_method.cpp:30
↓ 2 callers
Function
base64_decode
* @brief Base64 Decoder * @details Decodes the Base64 string * @param base64_str Input as a Base64 string * @returns Base64 decoded string */
ciphers/base64_encoding.cpp:110
↓ 2 callers
Function
base64_encode
* @brief Base64 Encoder * @details Converts the given string to Base64 equivalent. * @param input Input as a string * @returns Base64 encoded strin
ciphers/base64_encoding.cpp:40
↓ 2 callers
Function
binomial_variance
finds the variance of the binomial distribution * \param [in] n * \param [in] p * \returns \f$\sigma^2 = n\cdot p\cdot (1-p)\f$ */
probability/binomial_dist.cpp:29
↓ 2 callers
Function
boruvkas
* @brief the implementation of boruvka's algorithm * @param adj a graph adjancency matrix stored as 2d vectors. * @returns the MST as 2d vectors */
greedy_algorithms/boruvkas_minimum_spanning_tree.cpp:60
↓ 2 callers
Method
bottom
* @brief Displays the bottom element of the stack * * @return The bottom element of the stack * @throws std::out_of_range if the stack
data_structures/stack_using_array.cpp:97
↓ 2 callers
Function
createNode
* @brief creates and returns a new node * @param[in] data value stored in the node * @return newly created node */
data_structures/avltree.cpp:25
↓ 2 callers
Function
create_hash
* convert a string to an intger - called as hashing function * \param[in] s source of string to hash * \param[in] n length of substring to hash * \
strings/rabin_karp.cpp:25
↓ 2 callers
Function
create_random_array
sorting/insertion_sort_recursive.cpp:94
↓ 2 callers
Function
create_random_array
sorting/insertion_sort.cpp:101
↓ 2 callers
Function
cross
* @brief Function to calculate the cross product of the passed arrays * containing the direction ratios of the two mathematical vectors. * @param A
math/vector_cross_product.cpp:74
↓ 2 callers
Function
decrypt
* @brief a1z26 decryption implementation * @param text is the encrypted text input * @param bReturnUppercase is if the decoded string should be in u
ciphers/a1z26_cipher.cpp:78
↓ 2 callers
Function
decrypt
* Decrypt given morse coded text. * @param text text to be decrypted * @returns new decrypted text */
ciphers/morse_code.cpp:216
↓ 2 callers
Function
decrypt
* Decrypt given text using XOR cipher. * @param text text to be encrypted * @param key to be used for decryption * @return
ciphers/xor_cipher.cpp:61
↓ 2 callers
Function
decrypt
* Decrypt given text using vigenere cipher. * @param text text to be decrypted * @param key key to be used for decryption *
ciphers/vigenere_cipher.cpp:92
↓ 2 callers
Function
decrypt
* Decrypt given text using caesar cipher. * @param text text to be decrypted * @param shift number of shifts to be applied
ciphers/caesar_cipher.cpp:81
↓ 2 callers
Function
deleteAll
search/median_search2.cpp:77
↓ 2 callers
Function
deleteList
* @brief This function dealocates memory related to the given list * It recursively deletes all of the nodes of the input list. * @param room the ro
operations_on_datastructures/get_size_of_linked_list.cpp:25
↓ 2 callers
Function
deleteNode
* @brief removes a given element from AVL tree * @param root of the tree * @param[in] element the element to be deleted from the tree * @return roo
data_structures/avltree.cpp:122
↓ 2 callers
Function
dequeue
data_structures/binary_search_tree.cpp:27
↓ 2 callers
Function
display_all
data_structures/node.hpp:31
↓ 2 callers
Function
distSq
* @brief A utility function to return square of distance between p1 and p2. * @param p1 Co-ordinates of Point 1 <int, int>. * @param p2 Co-ordinates
geometry/graham_scan_functions.hpp:92
↓ 2 callers
Function
editDistDP
* @brief Calculates and stores the result * of all the sub-problems, so that we don't have to recur to compute * the minimum cost of a particular
dynamic_programming/minimum_edit_distance.cpp:92
↓ 2 callers
Method
empty
* @brief Checks if the stack is empty * @return true if the stack is empty, false otherwise */
data_structures/stack_using_array.cpp:41
↓ 2 callers
Function
encrypt
* Encrypt given text using morse code. * @param text text to be encrypted * @returns new encrypted text */
ciphers/morse_code.cpp:202
↓ 2 callers
Function
encrypt
* Encrypt given text using XOR cipher. * @param text text to be encrypted * @param key to be used for encyption * @return n
ciphers/xor_cipher.cpp:47
↓ 2 callers
Function
encrypt
Unnamed namespace * Encrypt given text using vigenere cipher. * @param text text to be encrypted * @param key to be used for encrypt
ciphers/vigenere_cipher.cpp:73
↓ 2 callers
Function
encrypt
Unnamed namespace * Encrypt given text using caesar cipher. * @param text text to be encrypted * @param shift number of shifts to be
ciphers/caesar_cipher.cpp:65
↓ 2 callers
Function
enqueue
data_structures/binary_search_tree.cpp:25
↓ 2 callers
Function
fast_power_linear
math/fast_power.cpp:50
↓ 2 callers
Function
fib
Compute fibonacci numbers using the relation * \f[f(n)=f(n-1)+f(n-2)\f] * and returns the result as a large_number type. */
math/fibonacci_large.cpp:24
↓ 2 callers
Function
fibonacci_search
* @brief using fibonacci search algorithm finds an index of a given element in a sorted array * * @param arr sorted array * @param value value tha
search/fibonacci_search.cpp:23
↓ 2 callers
Method
find_item
Return true if the requested item (sent in as an argument) is in the list, otherwise return false */
data_structures/cll/cll.cpp:78
↓ 2 callers
Method
fit
* Update the weights of the model using supervised learning for one * feature vector * \param[in] x feature vector * \param[in] y known
machine_learning/adaline_learning.cpp:119
↓ 2 callers
Method
getMin
Returns the minimum key (key at root) from min heap */
data_structures/binaryheap.cpp:43
↓ 2 callers
Method
getParents
* @brief Method to print all the parents of i, or the path from i to * representative. * @param i element of some set * @returns void
data_structures/dsu_union_rank.cpp:120
↓ 2 callers
Method
getVertices
* @return number of vertices in the graph. */
graph/cycle_check_directed_graph.cpp:111
↓ 2 callers
Method
get_XY_from_csv
* Function to get X and Y from csv file (where X = data, Y = label) * @param file_name csv file name * @param last_label flag for whether la
machine_learning/neural_network.cpp:380
↓ 2 callers
Function
get_char
* This function finds character for given value (i.e.A-Z) * @param x value for which we want character * @return correspon
ciphers/vigenere_cipher.cpp:51
↓ 2 callers
Function
get_char
* This function finds character for given value (i.e.A-Z) * @param x value for which we want character * @returns correspo
ciphers/caesar_cipher.cpp:43
↓ 2 callers
Function
get_inverse
machine_learning/ordinary_least_squares_regressor.cpp:226
↓ 2 callers
Method
get_k_th
* @brief Get the KTH largest value (External method) * @param k The queried rank * @return The element ranked number x */
data_structures/treap.cpp:214
↓ 2 callers
Method
get_predecessor
* @brief Get the predecessor node of element k * @param k The queried element * @return The predecessor */
data_structures/treap.cpp:172
↓ 2 callers
Method
get_rank
* @brief Get the rank of specified element (External method) * @param k The queried element * @return The rank of element k */
data_structures/treap.cpp:220
↓ 2 callers
Function
get_value
* This function finds value for given character (i.e.0-25) * @param c character for which we want value * @returns returns c
ciphers/caesar_cipher.cpp:53
↓ 2 callers
Function
getnode
This will return the index of the first free node present in the avail list */
data_structures/linkedlist_implentation_usingarray.cpp:32
↓ 2 callers
Function
glutBitmapString
A wrapper that is not available in all GLUT implementations. */
graphics/spirograph.cpp:130
↓ 2 callers
Function
h
* Mode of hash detection : * Division method * \param [in] key to hash * \returns hash value for `key` */
search/hash_search.cpp:45
↓ 2 callers
Method
h_stack
divide_and_conquer/strassen_matrix_multiplication.cpp:134
↓ 2 callers
Function
heapSort
sorting/heap_sort.cpp:84
↓ 2 callers
Function
heapify
sorting/heap_sort.cpp:58
↓ 2 callers
Function
height
* @param[in] root the root of the tree * @return height of tree */
data_structures/avltree.cpp:38
↓ 2 callers
Method
inOrderIterative
* @brief inOrderIterative() function that will perform the inorder traversal * iteratively, and return the result array that contain the inorder tra
others/iterative_tree_traversals.cpp:164
↓ 2 callers
Function
init_pattern
* @brief A function that initializes pattern * * @param str Text used for initialization * @param arg Initialized structure * @returns void */
strings/boyer_moore.cpp:153
↓ 2 callers
Method
insert
* @brief Insert a new value to the stream * @param value New value to insert */
probability/windowed_median.cpp:129
↓ 2 callers
Method
insert
* Insert a word into the trie. * @param word which needs to be inserted into the string. */
data_structures/trie_modern.cpp:109
↓ 2 callers
Method
insert
insert string into the trie * @param str String to insert in the tree */
data_structures/trie_tree.cpp:77
↓ 2 callers
Function
isBigEndian
* @brief Checks whether integers are stored as big endian or not * @note Taken from [this](https://stackoverflow.com/a/1001373) StackOverflow * post
hashing/md5.cpp:77
↓ 2 callers
Function
isBipartite
* @brief returns true if the given graph is bipartite else returns false * @param graph is a 2D matrix whose rows or the first index signify the node
graph/is_graph_bipartite2.cpp:76
↓ 2 callers
Method
is_bipartite
* @brief function that checks whether the graph is bipartite or not * the function returns true if the graph is a bipartite graph * the function ret
graph/is_graph_bipartite.cpp:106
↓ 2 callers
Function
is_number
games/memory_game.cpp:62
↓ 2 callers
Function
iterativeQuickSort
* @brief The main sorting function * @details The iterative quick sort uses * the stack instead of recursion for saving * and restoring the environ
sorting/quick_sort_iterative.cpp:58
↓ 2 callers
Function
leftRotate
* @param root of the tree to be rotated * @return node after left rotation */
data_structures/avltree.cpp:67
↓ 2 callers
Method
lower
* @brief returns lower 64-bit integer part * @returns returns lower 64-bit integer part */
ciphers/uint128_t.hpp:202
↓ 2 callers
Function
lu_decomposition
numerical_methods/lu_decomposition.h:29
↓ 2 callers
Function
mag
* @brief Calculates the magnitude of the mathematical vector from it's * direction ratios. * @param vec an array containing the direction ratios of
math/vector_cross_product.cpp:91
↓ 2 callers
Function
mat_mul
* Perform multiplication of two matrices. * * R2 must be equal to C1 * * Resultant matrix size should be R1xC2 * \param[in] A first matrix to multi
numerical_methods/qr_eigen_values.cpp:54
↓ 2 callers
Function
maxCircularSum
* @brief returns the maximum contiguous circular sum of an array * * @param arr is the array/vector * @return int which is the maximum sum */
dynamic_programming/maximum_circular_subarray.cpp:26
↓ 2 callers
Function
maxKnapsackValue
dynamic_programming/0_1_knapsack.cpp:51
↓ 2 callers
Function
max_subarray_sum
others/kadanes3.cpp:29
↓ 2 callers
Function
merge
sorting/non_recursive_merge_sort.cpp:57
↓ 2 callers
Function
middleNode
* This function searches for the median of a linked list. * @param head The head of the linked list. * @returns Median node of the linked list. */
search/median_search2.cpp:59
← previous
next →
401–500 of 2,100, ranked by callers