MCPcopy Create free account

hub / github.com/TheAlgorithms/C / functions

Functions1,322 in github.com/TheAlgorithms/C

↓ 2 callersFunctionswap
misc/rselect.c:4
↓ 2 callersFunctionswap
* @brief Swap numbers by reference(using pointers) * @param first pointer to first number * @param second pointer to second number * @returns void
sorting/odd_even_sort.c:26
↓ 2 callersFunctionswap
Swap function to swap two values*/
sorting/quick_sort.c:17
↓ 2 callersFunctionswap
Swap function to swap two values
sorting/cycle_sort.c:18
↓ 2 callersFunctionswap
sorting/shaker_sort.c:4
↓ 2 callersFunctionswap
leetcode/src/75.c:1
↓ 2 callersFunctionternarySearch
Function to perform Ternary Search
searching/ternary_search.c:5
↓ 2 callersFunctiontrie_new
--Create new trie node--*/
data_structures/trie/trie.c:24
↓ 2 callersFunctionu128_increment
* @brief increment an 128-bit number by a given amount * * @param dest the value being incremented * @param n what dest is being increased by * *
hash/hash_blake2b.c:147
↓ 2 callersFunctionupdate
* @brief To update the completion time, turn around time and waiting time of * the processes * @param root pointer to the head of the queue * @para
process_scheduling_algorithms/non_preemptive_priority_scheduling.c:150
↓ 2 callersFunctionvalidatePosition
* @brief Function validatePosition * Responsible for checking if the position can receive the boat. * @param mat board * @param boat boat * @param
games/naval_battle.c:43
↓ 2 callersFunctionvalueOcurranceCArray
data_structures/array/carray.c:237
↓ 2 callersFunctionvecswap
sorting/multikey_quick_sort.c:29
↓ 2 callersFunctionvecswap2
sorting/multikey_quick_sort.c:91
↓ 1 callersFunctionBLAKE2B
* @brief driver function to perform the hashing as described in specification * * pseudocode: (credit to authors of RFC 7693 listed above) * FUNCTI
hash/hash_blake2b.c:286
↓ 1 callersFunctionBellmanFord
The main function that finds the shortest path from given source to all other vertices using Bellman-Ford.It also detects negative weight cycle
data_structures/graphs/bellman_ford.c:69
↓ 1 callersFunctionBucketSort
sorting/bucket_sort.c:25
↓ 1 callersFunctionDijkstra
The main function that finds the shortest path from given source to all other vertices using Dijkstra's Algorithm.It doesn't work on negative weights
data_structures/graphs/dijkstra.c:63
↓ 1 callersFunctionFloydWarshall
The main function that finds the shortest path from a vertex to all other vertices using Floyd-Warshall Algorithm.
data_structures/graphs/floyd_warshall.c:51
↓ 1 callersFunctionGCD
Euclid's algorithm
math/gcd.c:4
↓ 1 callersFunctionInsertionSort
Insertion Sort */
sorting/bucket_sort.c:107
↓ 1 callersFunctionKruskalMST
The main function to construct MST using Kruskal's algorithm
data_structures/graphs/kruskal.c:91
↓ 1 callersFunctionList_append
Append 2 lists together */
data_structures/list/list.c:70
↓ 1 callersFunctionList_length
Length of list */
data_structures/list/list.c:29
↓ 1 callersFunctionList_list
Create and return a list */
data_structures/list/list.c:52
↓ 1 callersFunctionOK
* Check if element `v` is valid to place at (x,y) location. * @param a ::sudoku to check * @param x row to place value * @param y column to place v
misc/sudoku_solver.c:111
↓ 1 callersFunctionOKbox
* Check if a 3x3 box is valid * @param a matrix to check * @param x row index of the element to check * @param y column index of the element to che
misc/sudoku_solver.c:85
↓ 1 callersFunctionOKcol
* Check if `y`^th column is valid * @param a ::sudoku to check * @param x ignored row * @param y column to check * @param v value to check if it r
misc/sudoku_solver.c:67
↓ 1 callersFunctionOKrow
* Check if `x`^th row is valid * @param a ::sudoku to check * @param x row to check * @param y ignored column * @param v value to check if it repe
misc/sudoku_solver.c:48
↓ 1 callersFunctionPrintSortedPermutations
misc/lexicographic_permutations.c:14
↓ 1 callersFunctionQueueDequeue
remove int from front of queue
data_structures/graphs/queue.c:67
↓ 1 callersFunctionQueueIsEmpty
check whether queue is empty
data_structures/graphs/queue.c:44
↓ 1 callersFunctionRadixSort
sorting/radix_sort.c:14
↓ 1 callersFunctionRecursionInsertionSort
* @addtogroup sorting Sorting algorithms * @{ */ * Insertion sort algorithm implements using Recursion * @param arr array to be sorted * @param s
sorting/insertion_sort_recursive.c:20
↓ 1 callersFunctionStack_init
Initial stack */
data_structures/stack/stack_linked_list/stack.c:22
↓ 1 callersFunctionTotalNodes
leetcode/src/173.c:31
↓ 1 callersFunctionTraverseAndAssign
leetcode/src/173.c:19
↓ 1 callersFunctionUnion
A function that does union of two sets of x and y (uses union by rank)
data_structures/graphs/kruskal.c:60
↓ 1 callersFunctionadaline_activation
[Heaviside activation * function](https://en.wikipedia.org/wiki/Heaviside_step_function) <img * src="https://upload.wikimedia.org/wikipedia/commons/
machine_learning/adaline_learning.c:105
↓ 1 callersFunctionadaline_fit_sample
* Update the weights of the model using supervised learning for one feature * vector * * \param[in] ada adaline model to fit * \param[in] x featur
machine_learning/adaline_learning.c:158
↓ 1 callersFunctionaddEdge
Adds the given edge to the graph
data_structures/graphs/bellman_ford.c:29
↓ 1 callersFunctionaddEdge
Adds bidirectional edge to graph
data_structures/graphs/bfs.c:132
↓ 1 callersFunctionaddEdge
Adds the given edge to the graph
data_structures/graphs/dijkstra.c:27
↓ 1 callersFunctionaddEdge
Creates a bidirectional graph
data_structures/graphs/dfs.c:107
↓ 1 callersFunctionaddEdge
Adds the given edge to the graph
data_structures/graphs/floyd_warshall.c:27
↓ 1 callersFunctionaddEdge
Creates a unidirectional graph
data_structures/graphs/topological_sort.c:127
↓ 1 callersFunctionadd_digit
* add a digit to the large number * \param[in,out] num * \param[in] value value of the digit to insert */
math/factorial_large_number.c:48
↓ 1 callersFunctionadd_item_index
data_structures/dictionary/dict.c:64
↓ 1 callersFunctionadd_numbers
* Function to add arbitrary length decimal integers stored in an array. * a + b = c = new b */
project_euler/problem_13/sol1.c:48
↓ 1 callersFunctionadd_numbers
* Function to add arbitraty length decimal integers stored in an array.\n * a + b = c = new b */
project_euler/problem_25/sol1.c:19
↓ 1 callersFunctionaffine_decrypt
* @brief Decrypts an affine ciphertext * * @param s string to be decrypted * @param key Key used when s was encrypted * * @returns void */
cipher/affine.c:132
↓ 1 callersFunctionaffine_encrypt
* @brief Encrypts character string `s` with key * * @param s string to be encrypted * @param key affine key used for encryption * * @returns void
cipher/affine.c:110
↓ 1 callersFunctionallocateMemoryForNode
* @brief Reserves memory for new node * @returns a pointer to the newly allocated node if memory IS successfully reserved * @returns `NULL` if memor
data_structures/binary_trees/words_alphabetical.c:102
↓ 1 callersFunctionbead_sort
This is where the sorting of the array takes place * @param [in,out] a array to be sorted * @param [in] len Array Size */
sorting/bead_sort.c:37
↓ 1 callersFunctionbfs
data_structures/graphs/bfs.c:74
↓ 1 callersFunctionbinarySearch
sorting/binary_insertion_sort.c:18
↓ 1 callersFunctionbinarySearch
searching/other_binary_search.c:5
↓ 1 callersFunctionbinary_search
* Function: binary_search * \brief algorithm that search the index of the given item * \details recursive function that search the given element in
searching/exponential_search.c:56
↓ 1 callersFunctionbubbleSort
* Bubble sort algorithm implements using recursion * @param arr array to be sorted * @param size size of array */
sorting/bubble_sort_recursion.c:29
↓ 1 callersFunctionbubbleSort
* Bubble sort algorithm implementation * @param arr array to be sorted * @param size size of array */
sorting/bubble_sort.c:43
↓ 1 callersFunctionbubbleSortCArray
data_structures/array/carray.c:190
↓ 1 callersFunctionbubble_sort
* @brief Bubble sort implementation * @param array_sort the array to be sorted * @returns void */
sorting/bubble_sort_2.c:24
↓ 1 callersFunctionbuildAST
* @brief recursively constructs a AST from a preprocessed regex string * @param input regex * @returns pointer to the resulting tree */
misc/mcnaughton_yamada_thompson.c:189
↓ 1 callersFunctionbuildBST
leetcode/src/109.c:1
↓ 1 callersFunctionbuild_maxheap
sorting/heap_sort.c:42
↓ 1 callersFunctioncalculateCentroid
! * Calculate centoid and assign it to the cluster variable * * @param observations an array of observations whose centroid is calculated * @para
machine_learning/k_means_clustering.c:97
↓ 1 callersFunctioncalculateNearst
! * Returns the index of centroid nearest to * given observation * * @param o observation * @param clusters array of cluster having centroids c
machine_learning/k_means_clustering.c:69
↓ 1 callersFunctioncalculate_tat
* @brief To calculate the average turn around time of all the processes * @param root pointer to the head of the queue * @returns float average turn
process_scheduling_algorithms/non_preemptive_priority_scheduling.c:282
↓ 1 callersFunctioncalculate_wt
* @brief To calculate the average waiting time of all the processes * @param root pointer to the head of the queue * @returns float average waiting
process_scheduling_algorithms/non_preemptive_priority_scheduling.c:307
↓ 1 callersFunctioncheckForCase2
data_structures/binary_trees/red_black_tree.c:343
↓ 1 callersFunctioncheckIsBst
Depth first search approach. Runtime: O(n) Space: O(1)
leetcode/src/98.c:13
↓ 1 callersFunctioncheckNode
Check the node after the insertion step
data_structures/binary_trees/red_black_tree.c:92
↓ 1 callersFunctioncheckSymmetric
leetcode/src/101.c:10
↓ 1 callersFunctioncheck_number
Checks if a given number is devisable by every number between 1 and 20 * @param n number to check * @returns 0 if not divisible * @returns 1 if div
project_euler/problem_5/sol2.c:30
↓ 1 callersFunctioncheck_number
Pretty naive implementation. Just checks every number if it's devisable by 1 * through 20 * @param n number to check * @returns 0 if not divisible
project_euler/problem_5/sol1.c:18
↓ 1 callersFunctioncheck_sorted
sorting/bogo_sort.c:5
↓ 1 callersFunctioncheck_termination
* check for termination condition * \param[in] delta point at which to evaluate the polynomial * \returns 0 if termination not reached * \returns 1
numerical_methods/durand_kerner_roots.c:83
↓ 1 callersFunctioncocktailSort
sorting/cocktail_sort.c:7
↓ 1 callersFunctioncollatz
* Computes the length of collatz sequence for a given * starting number */
project_euler/problem_14/sol1.c:27
↓ 1 callersFunctioncompare
* @brief To compare the priority of two processes based on their arrival time * and priority * @param a pointer to the first process * @param b poi
process_scheduling_algorithms/non_preemptive_priority_scheduling.c:199
↓ 1 callersFunctioncompileFromAST
misc/mcnaughton_yamada_thompson.c:279
↓ 1 callersFunctioncompte
compte plays the role of strlen so we can change it by an strlen function if you want that
misc/mirror.c:48
↓ 1 callersFunctioncomputeArray
searching/pattern_search/boyer_moore_search.c:8
↓ 1 callersFunctioncontains_hash
data_structures/hash_set/hash_set.c:51
↓ 1 callersFunctionconvert
* @brief convert function * @param infix[] : infix array provided by user * @param postfix[] : empty array to be given to convert() * @returns post
conversions/infix_to_postfix.c:130
↓ 1 callersFunctionconvert
* @brief Convert a string to the it's zigzag equivalent on a given number of * rows. * @param in the string in input. * @param numRows the desired
leetcode/src/6.c:29
↓ 1 callersFunctionconvertBST
leetcode/src/108.c:10
↓ 1 callersFunctionconvertValue
Converts octal number to decimal
conversions/octal_to_decimal.c:5
↓ 1 callersFunctionconverted_len
* @brief Calculate the final length of the converted number * @param nb to convert * @param base calculated from alphabet * @return Converted nb st
conversions/decimal_to_any_base.c:42
↓ 1 callersFunctionconvertion
* @brief Convert positive decimal integer into anybase recursively * @param nb to convert * @param alphabet inputed by user used for base convertion
conversions/decimal_to_any_base.c:58
↓ 1 callersFunctioncoundDevices
leetcode/src/2125.c:1
↓ 1 callersFunctioncount
* @brief Count func counts the number of * prime numbers. * @param arr contains the prime numbers * @param size denotes upto which prime numbers a
math/prime_sieve.c:42
↓ 1 callersFunctioncountSort
Counting sort according to the digit represented by place
sorting/radix_sort_2.c:20
↓ 1 callersFunctioncount_divisors
* Get number of divisors of a given number * * If \f$x = a \times b\f$, then both \f$a\f$ and \f$b\f$ are divisors of * \f$x\f$. Since multiplicati
project_euler/problem_12/sol1.c:19
↓ 1 callersFunctioncreate
* Initialize the stack to NULL. */
data_structures/stack.c:77
↓ 1 callersFunctioncreate
This function is responsible for creating the Circularly Linked List right from the BEGINNING. */
data_structures/linked_list/circular_linked_list.c:20
↓ 1 callersFunctioncreate
data_structures/queue/queue.c:20
↓ 1 callersFunctioncreateGraph
Constructs a graph with V vertices and E edges
data_structures/graphs/bellman_ford.c:21
↓ 1 callersFunctioncreateGraph
Allocates memory for graph data structure, in adjacency list format
data_structures/graphs/bfs.c:114
↓ 1 callersFunctioncreateGraph
Constructs a graph with V vertices and E edges
data_structures/graphs/dijkstra.c:14
← previousnext →301–400 of 1,322, ranked by callers