MCPcopy Create free account

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

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

Method_trz
* @brief Trailing zeroes in binary * @details Calculates leading zeros in 128-bit integer * @returns Integer denoting Trailing zeroes *
ciphers/uint128_t.hpp:163
Method_trz
* @brief Trailing zeroes in binary * @details Calculates leading zeros in 256-bit integer * @returns Integer denoting Trailing zeroes *
ciphers/uint256_t.hpp:135
Methodactivation
Defines activation function as Heaviside's step function. * \f[ * f(x) = \begin{cases} * -1 & \forall x \le 0\\ * 1 & \forall x >
machine_learning/adaline_learning.cpp:186
Methodadaline
* Default constructor * \param[in] num_features number of features present * \param[in] eta learning rate (optional, default=0.1) * \pa
machine_learning/adaline_learning.cpp:55
MethodaddEdge
Add an edge in the graph. * * @param edge that needs to be added. */
graph/cycle_check_directed_graph.cpp:125
MethodaddVertices
Add vertices in the graph. * * @param num is the number of vertices to be added. It adds 1 vertex by * default. * */
graph/cycle_check_directed_graph.cpp:119
Methodbatch_predict
* Function to get prediction of model on batch * @param X array of feature vectors * @return returns predicted values as vector */
machine_learning/neural_network.cpp:464
Methodbfs
graph/max_flow_with_ford_fulkerson_and_edmond_karp_algo.cpp:26
Methodbfs
* @brief This function checks for the possibility of augmented path availability * @returns `true` if there is an augmenting path available * @retu
graph/hopcroft_karp.cpp:133
FunctionbinExpo_alt
Iterative function to calculate exponent in \f$O(\log(n))\f$ using binary exponent.
math/binary_exponent.cpp:42
Functionbinary_s
search/exponential_search.cpp:34
Methodbinary_search_tree
* @brief Construct a new Binary Search Tree object. * */
data_structures/binary_search_tree2.cpp:247
Methodbst_node
* Constructor for bst_node, used to simplify node construction and * smart pointer construction. * @param _value The value of the cons
data_structures/binary_search_tree2.cpp:35
Methodchain_query
* @brief Utility function to break down a path query into two chain queries * @param a node where the path starts * @param b node where the
range_queries/heavy_light_decomposition.cpp:415
Methodchange_root
* @brief Set the root for the tree * @param new_root the new root * @returns void */
range_queries/heavy_light_decomposition.cpp:169
Methodchar_to_int
* @brief Convert a character to integer for indexing * * @param ch character to index * @return unsigned integer index */
data_structures/trie_tree.cpp:38
Methodcheck_size_match
* convenient function to check if input feature vector size matches the * model weights size * \param[in] x fecture vector to check * \
machine_learning/adaline_learning.cpp:196
Methodclear
* @brief removes all elements from the queue */
data_structures/queue.hpp:90
Methodcll
Constructor */
data_structures/cll/cll.cpp:8
Methodcodec
* @brief Convenience function to perform block cipher operations. The * operations are identical for both encryption and decryption. *
ciphers/hill_cipher.cpp:211
Methodcomb
* @brief Any associative function that combines x and y * @param x The first operand * @param y The second operand * @return Some as
data_structures/segment_tree.cpp:42
Methodcombine
* @brief Function that specifies the type of operation involved when * segments are combined * @param lhs the left segment * @param rhs
range_queries/heavy_light_decomposition.cpp:278
Functioncompare
* @brief A function used by library function qsort() to sort an array of * points with respect to the first point * @param vp1 Co-ordinates of Point
geometry/graham_scan_functions.hpp:120
Functioncompare
sorting/shell_sort2.cpp:87
MethodcomputeFactorialsMod
* @brief computes the array of values of factorials reduced modulo mod * @param max_arg_val argument of the last factorial stored in the result
math/ncr_modulo_p.cpp:92
Methodcopy_all_nodes_from_list
data_structures/reverse_a_linked_list.cpp:198
MethodcreateNode
data_structures/circular_queue_using_linked_list.cpp:23
Methoddecrypt_text
* @brief Decrypt a given text using a given key * * @param text string to decrypt * @param decrypt_key key for decryption * @retu
ciphers/hill_cipher.cpp:457
MethoddeleteElement
* Deletes an element by key and prints if has been removed successfully * @param key is number that is used for comparision. */
data_structures/skip_list.cpp:133
MethoddeleteString
* removes the string if it is not a prefix of any other * string, if it is then just sets the ::data_structure::trie::isEndofWord * to fals
data_structures/trie_tree.cpp:134
Methoddelete_all_nodes
* @brief calls delete operator on every node in the represented list */
data_structures/reverse_a_linked_list.cpp:188
Methoddelfix
data_structures/rb_tree.cpp:223
Methoddfs
graph/bridge_finding_with_tarjan_algorithm.cpp:17
Methoddfs
* @brief This functions checks whether an augmenting path is available exists beginning with free vertex u * @param u represents position of vertex
graph/hopcroft_karp.cpp:191
Methoddfs_hc
* @brief Utility function to assign heavy child to each node (-1 for a leaf * node) * @param u current dfs node * @param p the parent o
range_queries/heavy_light_decomposition.cpp:356
Methoddfs_labels
* @brief Utility function to lable the nodes so that heavy chains have a * contigous lable * @param u current dfs node * @param p the p
range_queries/heavy_light_decomposition.cpp:396
Methoddfs_lca
* @brief Utility function to populate the t_par vector * @param u current dfs node * @param p the parent of node u * @returns void
range_queries/heavy_light_decomposition.cpp:118
Methoddfs_par
* @brief Utility function to assign highest parent that can be reached * though heavy chains * @param u current dfs node * @param p the
range_queries/heavy_light_decomposition.cpp:377
Methoddfs_size
* @brief Utility function to compute sub-tree sizes * @param u current dfs node * @param p the parent of node @param u * @returns void
range_queries/heavy_light_decomposition.cpp:103
Functiondijkstra
* @brief The main function that finds the shortest path from a given source * to all other vertices using Dijkstra's Algorithm. * @note This doesn't
greedy_algorithms/dijkstra_greedy.cpp:124
Methoddirection
* We will find direction of line here respect to @first_point. * Here @second_point and @third_point is first and second points * of the lin
geometry/line_segment_intersection.cpp:63
Methoddisplay
data_structures/rb_tree.cpp:376
Methoddisplay
Show stack */
data_structures/stack.hpp:24
Methoddisplay
* @brief prints the queue into the std::cout */
data_structures/queue.hpp:17
Methoddivide
* @brief divide function for uint128_t and other integer types. * @details divide this value and * @param p 128-bit unsigned integer *
ciphers/uint128_t.hpp:455
Methoddivide
* @brief divide function for uint256_t and other integer types. * @details divide this value and * @param p 256-bit unsigned integer *
ciphers/uint256_t.hpp:421
Methoddouble_linked_list
data_structures/doubly_linked_list.cpp:13
Functiondrelu
* Derivative of relu function * @param X Value * @returns derivative of relu(x) */
machine_learning/neural_network.cpp:81
Functiondsigmoid
* Derivative of sigmoid function * @param X Value * @return Returns derivative of sigmoid(x) */
machine_learning/neural_network.cpp:67
Methoddsu
* @brief contructor for initialising all data members. * @param n number of elements */
data_structures/dsu_path_compression.cpp:46
Methoddsu
* @brief constructor for initialising all data members * @param n number of elements */
data_structures/dsu_union_rank.cpp:45
Functiondtanh
* Derivative of Sigmoid function * @param X Value * @return Returns derivative of tanh(x) */
machine_learning/neural_network.cpp:95
Methodencrypt_text
* @brief Encrypt a given text using a given key * * @param text string to encrypt * @param encrypt_key key for encryption * @retu
ciphers/hill_cipher.cpp:445
MethodensureNotEmpty
data_structures/stack.hpp:36
MethodensureNotEmpty
* @brief throws an exception if queue is empty * @exception std::invalid_argument if queue is empty */
data_structures/queue.hpp:38
MethoderaseFromSorted
* @brief Erases a value from a sorted multi-value BST * @param value Value to insert */
probability/windowed_median.cpp:95
Methodevaluate_from_csv
* Function to evaluate model on data stored in csv file * @param file_name csv file name * @param last_label flag for whether label is in fi
machine_learning/neural_network.cpp:638
Functionextract_byte
hashing/sha256.cpp:157
Functionf
* @brief A function f(x) that will be used to test the method * @param x The independent variable xi * @returns the value of the dependent variable
numerical_methods/midpoint_integral_method.cpp:90
Methodfenwick_tree
range_queries/fenwick_tree.cpp:50
MethodfindSet
* @brief Method to find the representative of the set to which i belongs * to, T(n) = O(1) * @param i element of some set * @returns re
data_structures/dsu_path_compression.cpp:74
MethodfindSet
* @brief Method to find the representative of the set to which i belongs * to, T(n) = O(logN) * @param i element of some set * @returns
data_structures/dsu_union_rank.cpp:62
Functionfind_non_repeating_integer
* @brief The main function implements find single number * @param nums vector of integers * @returns returns the integer that occurs only once */
bit_manipulation/find_non_repeating_number.cpp:39
Methodfind_zero
A helper array to evaluate the next state from current state; * @brief Finds an empty space in puzzle (in this case; a zero) * @returns a pair in
machine_learning/a_star_search.cpp:77
FunctionfreeNode
This function when called will delete the node with * the index presented as an argument, and will put * back that node into the array. */
data_structures/linkedlist_implentation_usingarray.cpp:42
Functiong
* @brief A function g(x) that will be used to test the method * @param x The independent variable xi * @returns the value of the dependent variable
numerical_methods/midpoint_integral_method.cpp:97
Functiong
@brief Another test function */
numerical_methods/composite_simpson_rule.cpp:115
Methodgcd
ciphers/hill_cipher.cpp:139
FunctiongenerateUnsortedArray
sorting/random_pivot_quick_sort.cpp:160
Methodgenerate_decryption_key
* @brief Generate decryption matrix from an encryption matrix key. * * @param encrypt_key encryption key for which to create a decrypt key
ciphers/hill_cipher.cpp:372
Methodgenerate_encryption_key
* @brief Generate encryption matrix of a given size. Larger size matrices * are difficult to generate but provide more security. Important condit
ciphers/hill_cipher.cpp:340
Methodgenerate_keys
* @brief Generate encryption and decryption key pair * * @param size size of matrix key (typically \f$\text{size}\le10\f$) * @param lim
ciphers/hill_cipher.cpp:424
Methodgeometric_distribution
* @brief Constructor for the geometric distribution * @param p The success probability */
probability/geometric_dist.cpp:64
Methodget_all_words
* @brief helper function to predict/recommend words that starts with a * given prefix from the end of prefix's node iterate through all the child
data_structures/trie_using_hashmap.cpp:160
Methodget_char_idx
* @brief Get the index of a character in the ::STRKEY * * @param ch character to search * @return index of character */
ciphers/hill_cipher.cpp:191
Functionget_final_status
cpu_scheduling_algorithms/non_preemptive_sjf_scheduling.cpp:228
Functionget_final_status
cpu_scheduling_algorithms/fcfs_scheduling.cpp:226
Methodget_idx_char
* @brief Get the character at a given index in the ::STRKEY * * @param idx index value * @return character at the index */
ciphers/hill_cipher.cpp:183
Methodget_inverse
ciphers/hill_cipher.cpp:251
Methodget_max
* @brief A utility function that returns the max element of the set to * which i belongs to * @param i element of some set * @returns m
data_structures/dsu_path_compression.cpp:156
Methodget_min
* @brief A utility function that returns the min element of the set to * which i belongs to * @param i element of some set * @returns m
data_structures/dsu_path_compression.cpp:163
Methodget_size
Get total element in list */
data_structures/cll/cll.cpp:74
FunctiongraphColoring
backtracking/graph_coloring.cpp:81
MethodhasChildren
* Function to check if a node has some children which can form words. * @param node whose character array of pointers need to be checked for
data_structures/trie_modern.cpp:41
FunctionhashDJB2
* @brief [Function djb2](http://www.cse.yorku.ca/~oz/hash.html) * to get hash for the given string. * * @param s string to get hash from * @return
data_structures/bloom_filter.cpp:166
FunctionhashInt_1
* @brief [Hash function for * test](https://stackoverflow.com/questions/664014/what-integer-hash-function-are-good-that-accepts-an-integer-hash-key)
data_structures/bloom_filter.cpp:199
FunctionhashInt_2
* @brief [Hash function for * test](https://stackoverflow.com/questions/664014/what-integer-hash-function-are-good-that-accepts-an-integer-hash-key)
data_structures/bloom_filter.cpp:213
FunctionhashStr
* @brief [Hash * function](https://stackoverflow.com/questions/8317508/hash-function-for-a-string), * to get hash for the given string. * * @param
data_structures/bloom_filter.cpp:182
Methodhash_chain
* @brief Construct a new chain object * * @param mod modulus of the chain */
hashing/chaining.cpp:35
Functionidentity_function
* Identity function * @param X Value * @return Returns x */
machine_learning/neural_network.cpp:112
Methodin_range
* @brief check whether the index value is bounded within the puzzle area * @param value index for the current board * @returns `true` if ind
machine_learning/a_star_search.cpp:92
Methodincrease_frequency
* @brief increase the frequency of node and push it in the respective list. * @param p_node the node to be updated */
others/lfu_cache.cpp:109
Methodinit
* @brief This function must be called after the tree adjacency list and * node values are populated The function initializes the required *
range_queries/heavy_light_decomposition.cpp:188
Methodinsert
< Pointer to root node of Binary Tree * @brief inserts a node in the Binary Tree, with the behaviouur of * a Binary Search Tree. * @details
operations_on_datastructures/reverse_binary_tree.cpp:65
MethodinsertToSorted
* @brief Inserts a value to a sorted multi-value BST * @param value Value to insert */
probability/windowed_median.cpp:69
Methodinsertfix
data_structures/rb_tree.cpp:70
MethodisCyclicBFS
Check if a graph has cycle or not. * * This function uses BFS to check if a graph is cyclic or not. * * @param graph which needs t
graph/cycle_check_directed_graph.cpp:250
MethodisCyclicDFS
Driver function to check if a graph has a cycle. * * This function uses DFS to check for cycle in the graph. * * @param graph whic
graph/cycle_check_directed_graph.cpp:213
MethodisCyclicDFSHelper
Helper function of "isCyclicDFS". * * @param adjList is the adjacency list representation of some graph. * @param state is the state of
graph/cycle_check_directed_graph.cpp:171
MethodisEmpty
* function checks if list is empty * @returns true if list is empty * @returns false if list is not empty */
data_structures/linked_list.cpp:111
← previousnext →1,401–1,500 of 2,100, ranked by callers