MCPcopy Create free account

hub / github.com/TheAlgorithms/C-Plus-Plus / functions

Functions2,100 in github.com/TheAlgorithms/C-Plus-Plus

↓ 1 callersFunctionUnion
* * Union operation combines two disjoint sets to make a single set * in this union function we pass two elements and check if they are * from diff
data_structures/disjoint_set.cpp:78
↓ 1 callersFunctionZ_function
* @brief Generate the Z-function for the inputted string. * \param[in] pattern text on which to apply the Z-function * \returns the Z-function outpu
strings/z_function.cpp:29
↓ 1 callersMethod__get_integer_from_string
* @brief Get integer from given string. * @details Create an integer from a given string * @param str integer string, can be hexadecimal (st
ciphers/uint128_t.hpp:70
↓ 1 callersMethodabs
* \brief Member function to give the modulus of our complex number. * Member function to which gives the absolute value (modulus) of our * c
math/complex_numbers.cpp:79
↓ 1 callersFunctionadd
* function to add two string numbers * \param [in] a first number in string to add * \param [in] b second number in string to add * \returns sum as
math/string_fibonacci.cpp:25
↓ 1 callersMethodadd
* @brief create and add a new node with a give value and at a given height * * @param x value at the new node * @param h height of the
hashing/chaining.cpp:45
↓ 1 callersMethodadd
dynamic_programming/catalan_numbers.cpp:32
↓ 1 callersFunctionaddEdge
* \brief * Adds and edge between two vertices of graph say u and v in this * case. * * @param adj Adjacency list representation of graph * @param
graph/depth_first_search.cpp:56
↓ 1 callersMethodaddEdge
Adds the given edge to the graph
dynamic_programming/floyd_warshall.cpp:35
↓ 1 callersMethodaddEdge
Adds the given edge to the graph
dynamic_programming/bellman_ford.cpp:27
↓ 1 callersFunctionaddInfo
Information about the adding process * @param key key value to hash and add to table */
hashing/quadratic_probing_hash_table.cpp:207
↓ 1 callersFunctionaddInfo
Information about the adding process * @param key key value to add to table */
hashing/double_hash_hash_table.cpp:212
↓ 1 callersFunctionaddInfo
Information about the adding process * @param key key value to hash and add */
hashing/linear_probing_hash_table.cpp:186
↓ 1 callersMethodaddProcess
* @brief Adds the process to the ready queue if it isn't already there * @param id Process ID * @param arrival Arrival time of the process
cpu_scheduling_algorithms/non_preemptive_sjf_scheduling.cpp:127
↓ 1 callersMethodaddProcess
* @brief Adds the process to the ready queue if it isn't already there * @param id Process ID * @param arrival Arrival time of the process
cpu_scheduling_algorithms/fcfs_scheduling.cpp:130
↓ 1 callersFunctionaddition_rule_dependent
Calculates the probability of the events A or B for dependent events * note that if value of B_given_A is unknown, use chainrule to find it * \param
probability/addition_rule.cpp:25
↓ 1 callersFunctionaddition_rule_independent
* calculates the probability of the independent events A or B for independent * events * \parama [in] A probability of event A * \parama [in] B pro
probability/addition_rule.cpp:14
↓ 1 callersFunctionand_test
namespace strings * @brief A test case in which we search for every appearance of the word 'and' * @param text The text in which we search for appear
strings/boyer_moore.cpp:220
↓ 1 callersFunctionans
! Wrapper for Fibonacci * \param[in] n \f$n^\text{th}\f$ Fibonacci number * \return \f$n^\text{th}\f$ Fibonacci number */
others/matrix_exponentiation.cpp:91
↓ 1 callersMethodarg
* \brief Member function to give the argument of our complex number. * @return Argument of our Complex number in radians. */
math/complex_numbers.cpp:87
↓ 1 callersFunctionassign_results
games/memory_game.cpp:289
↓ 1 callersFunctionbayes_AgivenB
returns P(A|B) */
probability/bayes_theorem.cpp:14
↓ 1 callersFunctionbayes_BgivenA
returns P(B|A) */
probability/bayes_theorem.cpp:20
↓ 1 callersFunctionbeadSort
function to perform the above algorithm
sorting/bead_sort.cpp:8
↓ 1 callersFunctionbinExpo
Recursive function to calculate exponent in \f$O(\log(n))\f$ using binary exponent.
math/binary_exponent.cpp:28
↓ 1 callersFunctionbinExpo
* @brief Calculate exponent with modulo using binary exponentiation in \f$O(\log b)\f$ time. * @param a The base * @param b The exponent * @param m
math/modular_inverse_fermat_little_theorem.cpp:67
↓ 1 callersFunctionbinary_search
sorting/binary_insertion_sort.cpp:63
↓ 1 callersFunctionbinomial_expected
finds the expected value of a binomial distribution * \param [in] n * \param [in] p * \returns \f$\mu=np\f$ */
probability/binomial_dist.cpp:22
↓ 1 callersFunctionbinomial_range_successes
calculates the probability of a result within a range (inclusive, inclusive) * \returns \f$\displaystyle \left.P(n,p)\right|_{x_0}^{x_1} = * \sum_{i
probability/binomial_dist.cpp:74
↓ 1 callersFunctionbinomial_standard_deviation
finds the standard deviation of the binomial distribution * \param [in] n * \param [in] p * \returns \f$\sigma = \sqrt{\sigma^2} = \sqrt{n\cdot p\c
probability/binomial_dist.cpp:36
↓ 1 callersFunctionbinomial_x_successes
calculates the probability of exactly x successes * \returns \f$\displaystyle P(n,p,x) = {n\choose x} p^x (1-p)^{n-x}\f$ */
probability/binomial_dist.cpp:65
↓ 1 callersFunctionbitCount
* This function returns the number of set bits in the given number. * @param value the number of which we want to count the number of set bits. * @r
bit_manipulation/hamming_distance.cpp:35
↓ 1 callersFunctionbitonicMerge
It recursively sorts a bitonic sequence in ascending order, if dir = 1, and in descending order otherwise (means dir=0). The sequence to be sorted
sorting/bitonic_sort.cpp:21
↓ 1 callersFunctionbitonicSort
This function first produces a bitonic sequence by recursively sorting its two halves in opposite sorting orders, and then calls bitonicMerge
sorting/bitonic_sort.cpp:33
↓ 1 callersFunctionbrute_force
* Find a pattern in a string by comparing the pattern to every substring. * @param text Any string that might contain the pattern. * @param patt
strings/brute_force_string_searching.cpp:21
↓ 1 callersFunctionbucketSort
Function to sort arr[] of size n using bucket sort
sorting/bucket_sort.cpp:7
↓ 1 callersFunctionbuild
* @brief function that builds the PSA * @param original_array original array of values * @returns void */
range_queries/prefix_sum_array.cpp:41
↓ 1 callersMethodbuildST
* @brief Builds the sparse table for computing min/max/gcd/lcm/...etc * for any contiguous sub-segment of the array.This is an example of *
data_structures/sparse_table.cpp:69
↓ 1 callersFunctionbuildTable
range_queries/sparse_table_range_queries.cpp:56
↓ 1 callersFunctionchar_to_morse
* Get the morse representation for given character. * @param c Character * @returns morse representation string of character */
ciphers/morse_code.cpp:33
↓ 1 callersFunctioncheck
* @brief Function that checks if the string passed in param can be * segmented from position 'pos', and then correctly go on to segment the * rest o
dynamic_programming/word_break.cpp:80
↓ 1 callersFunctioncheckBipartite
* @brief function to check whether the passed graph is bipartite or not * @param graph is a 2D matrix whose rows or the first index signify the node
graph/is_graph_bipartite2.cpp:37
↓ 1 callersFunctioncheck_all_zeros
math/gcd_of_n_numbers.cpp:53
↓ 1 callersFunctioncheck_if_equal
* compare if two sub-strings are equal * \param[in] str1 string pattern to search * \param[in] str2 text in which to search * \param[in] start1,end
strings/rabin_karp.cpp:60
↓ 1 callersFunctioncheck_termination
* check for termination condition * \param[in] delta point at which to evaluate the polynomial * \returns `false` if termination not reached * \ret
numerical_methods/durand_kerner_roots.cpp:92
↓ 1 callersFunctioncircle_area
math/area.cpp:63
↓ 1 callersFunctioncircle_perimeter
math/perimeter.cpp:63
↓ 1 callersFunctioncompAndSwap
The parameter dir indicates the sorting direction, ASCENDING or DESCENDING; if (a[i] > a[j]) agrees with the direction, then a[i] and a[j] are i
sorting/bitonic_sort.cpp:12
↓ 1 callersFunctioncomputeLogs
range_queries/sparse_table_range_queries.cpp:38
↓ 1 callersMethodcompute_next
dynamic_programming/catalan_numbers.cpp:26
↓ 1 callersFunctioncone_volume
math/volume.cpp:53
↓ 1 callersMethodconstruct
* @brief Constructing the segment tree with the early passed vector. Every * call creates a node to hold the sum of the given range, set its poin
range_queries/persistent_seg_tree_lazy_prop.cpp:107
↓ 1 callersFunctionconvexHull
* @brief Prints convex hull of a set of n points. * @param points vector of Point<int, int> with co-ordinates. * @param size Size of the vector. *
geometry/graham_scan_functions.hpp:139
↓ 1 callersFunctioncopy_all_nodes
* @brief creates a deep copy of a list starting at the input node * @param[in] node pointer to the first node/head of the list to be copied * @re
data_structures/reverse_a_linked_list.cpp:53
↓ 1 callersFunctioncountSort
sorting/counting_sort_string.cpp:6
↓ 1 callersFunctioncount_paths_dfs
* @brief Helper function to perform DFS and count the number of paths from node `u` to node `v` * @param A adjacency matrix representing the grap
graph/number_of_paths.cpp:34
↓ 1 callersFunctioncreate_list
* The same after the remainder will be added after the same hash header * To avoid conflict, zipper method is used * Insert elements into the linked
search/hash_search.cpp:55
↓ 1 callersFunctioncreate_matrix
* create a symmetric square matrix of given size with random elements. A * symmetric square matrix will *always* have real eigen values. * * \param
numerical_methods/qr_eigen_values.cpp:28
↓ 1 callersFunctioncreate_message_schedule_array
* @brief Creates the message schedule array * @param input Input string * @param byte_num Position of the first byte of the chunk * @return std::ar
hashing/sha256.cpp:195
↓ 1 callersFunctioncreatelist
creating the linked list with 'n' nodes
operations_on_datastructures/selectionsortlinkedlist.cpp:26
↓ 1 callersFunctioncube_surface_area
math/area.cpp:86
↓ 1 callersFunctioncube_surface_perimeter
math/perimeter.cpp:86
↓ 1 callersFunctioncube_volume
math/volume.cpp:28
↓ 1 callersFunctioncylinder_surface_area
math/area.cpp:109
↓ 1 callersFunctioncylinder_surface_perimeter
math/perimeter.cpp:111
↓ 1 callersFunctioncylinder_volume
math/volume.cpp:103
↓ 1 callersMethoddecreaseKey
Decreases value of key at index 'i' to new_val. It is assumed that new_val * is smaller than harr[i]. */
data_structures/binaryheap.cpp:76
↓ 1 callersMethoddel
data_structures/rb_tree.cpp:135
↓ 1 callersFunctiondeleteAll
greedy_algorithms/huffman.cpp:26
↓ 1 callersFunctiondeleteAll
others/iterative_tree_traversals.cpp:183
↓ 1 callersFunctiondeleteAll
data_structures/morrisinorder.cpp:84
↓ 1 callersFunctiondeleteAllNodes
* @brief calls delete on every node * @param root of the tree */
data_structures/avltree.cpp:151
↓ 1 callersMethoddeleteKey
This function deletes key at index i. It first reduced value to minus * infinite, then calls extractMin() */
data_structures/binaryheap.cpp:105
↓ 1 callersMethoddelete_word
* @brief delete a word/string from a trie * @param word string to delete from trie */
data_structures/trie_using_hashmap.cpp:122
↓ 1 callersFunctiondepth_first_search
* \brief * initiates depth first search algorithm. * * @param adj adjacency list of graph * @param start vertex from where DFS starts traversing.
graph/depth_first_search.cpp:99
↓ 1 callersFunctiondepth_first_search
dynamic_programming/tree_height.cpp:32
↓ 1 callersMethoddequeue
data_structures/queue_using_linkedlist.cpp:32
↓ 1 callersMethoddequeue
data_structures/circular_queue_using_linked_list.cpp:43
↓ 1 callersMethoddequeue
* @brief Remove element that is located at the first of the queue * @returns data that is deleted if queue is not empty */
data_structures/queue_using_array.cpp:76
↓ 1 callersFunctiondfs
* @brief Function to perform Depth First Search on the graph * @param v Starting vertex for depth-first search * @param visited Array representing w
graph/topological_sort.cpp:79
↓ 1 callersMethoddisp
data_structures/rb_tree.cpp:372
↓ 1 callersFunctiondisplay
* Function to print the orthogonalised vector * * @param r number of vectors * @param c dimenaion of vectors * @param B stores orthogonalised vect
numerical_methods/gram_schmidt.cpp:101
↓ 1 callersMethoddisplay
* @brief A function to display the current cache * @returns Void * */
others/lru_cache.cpp:121
↓ 1 callersMethoddisplay
data_structures/queue_using_linkedlist.cpp:47
↓ 1 callersMethoddisplay
* function displays all the elements in the list * @returns 'void' */
data_structures/linked_list.cpp:181
↓ 1 callersMethoddisplay
* @brief Utility function to show all elements in the queue */
data_structures/queue_using_array.cpp:94
↓ 1 callersMethoddisplay
* @brief Display the chain */
hashing/chaining.cpp:63
↓ 1 callersFunctiondisplayElements
sorting/wiggle_sort.cpp:86
↓ 1 callersMethoddisplayList
* Display skip list level */
data_structures/skip_list.cpp:191
↓ 1 callersFunctiondisplay_graph
graphics/spirograph.cpp:145
↓ 1 callersFunctiondouble_factorial_iterative
Compute double factorial using iterative method */
math/double_factorial.cpp:18
↓ 1 callersFunctiondouble_factorial_recursive
Compute double factorial using resursive method. * <br/>Recursion can be costly for large numbers. */
math/double_factorial.cpp:31
↓ 1 callersMethoddraw_sample
* @brief Generates a (discrete) sample according to the geometrical * distribution * @returns A geometrically distributed number in [1,\inft
probability/geometric_dist.cpp:125
↓ 1 callersFunctioneditDist
A Naive recursive C++ program to find * minimum number of operations to convert * str1 to str2. * O(3^m) */
dynamic_programming/edit_distance.cpp:26
↓ 1 callersFunctioneditDistDP
A DP based program * O(m x n) */
dynamic_programming/edit_distance.cpp:48
↓ 1 callersFunctioneggDrop
dynamic_programming/egg_dropping_puzzle.cpp:11
↓ 1 callersFunctionencrypt
* @brief a1z26 encryption implementation * @param text is the plaintext input * @returns encoded string with dashes to seperate letters */
ciphers/a1z26_cipher.cpp:51
↓ 1 callersMethodenqueue
data_structures/queue_using_linkedlist.cpp:20
↓ 1 callersMethodenqueue
* @brief Adds new element to the end of the queue * @param ele to be added to the end of the queue */
data_structures/queue_using_array.cpp:59
↓ 1 callersFunctioneq
define \f$f(x)\f$ to find root for. * Currently defined as: * \f[ * f(x) = x^3 - 4x - 9 * \f] */
numerical_methods/newton_raphson_method.cpp:30
← previousnext →601–700 of 2,100, ranked by callers