MCPcopy Create free account

hub / github.com/black-shadows/Cracking-the-Coding-Interview / functions

Functions382 in github.com/black-shadows/Cracking-the-Coding-Interview

↓ 1 callersFunctioncreate_minial_tree
Solutions/Chapter 4 Trees and Graphs/4.6.cpp:27
↓ 1 callersFunctioncreate_minimal_tree
Solutions/Chapter 4 Trees and Graphs/4.8.cpp:26
↓ 1 callersFunctioncreate_minimal_tree
Solutions/Chapter 4 Trees and Graphs/4.3.cpp:27
↓ 1 callersFunctioncreate_minimal_tree
Solutions/Chapter 4 Trees and Graphs/4.5.cpp:24
↓ 1 callersFunctiondivide
* @brief Computes a/b using only additions. * @note Complexity: O(max(|a|,|b|)) in time, O(1) in space. */
Solutions/Chapter 10 Mathematical/10.4.cpp:79
↓ 1 callersFunctionfetch
Solutions/Chapter 5 Bit Manipulation/5.7.cpp:12
↓ 1 callersFunctionfetch1
Solutions/Chapter 5 Bit Manipulation/5.7.cpp:35
↓ 1 callersFunctionfib
Solutions/Chapter 8 Recursion/8.1.cpp:9
↓ 1 callersFunctionfib1
Solutions/Chapter 8 Recursion/8.1.cpp:15
↓ 1 callersFunctionfib2
Solutions/Chapter 8 Recursion/8.1.cpp:49
↓ 1 callersMethodfind
Solutions/Chapter 20 Hard/20.8.cpp:52
↓ 1 callersFunctionfindNthToLast
Solutions/Chapter 2 Linked Lists/2.2.cpp:32
↓ 1 callersFunctionfindNthToLast1
Solutions/Chapter 2 Linked Lists/2.2.cpp:46
↓ 1 callersFunctionfind_level_linklists
Solutions/Chapter 4 Trees and Graphs/4.4.cpp:40
↓ 1 callersFunctionfind_number_1
* @brief Finds the k-th number of type (3^a)*(5^b)*(7^c) using brute force. * @note Complexity: O(k²) in time, O(k) in space. */
Solutions/Chapter 10 Mathematical/10.7.cpp:16
↓ 1 callersFunctionfind_number_2
* @brief Finds the k-th number of type (3^a)*(5^b)*(7^c) using three queues, * each one containing numbers which must still be multiplied by
Solutions/Chapter 10 Mathematical/10.7.cpp:53
↓ 1 callersFunctionfind_sum2
Solutions/Chapter 4 Trees and Graphs/4.8.cpp:74
↓ 1 callersFunctionfirst_ancestor
Solutions/Chapter 4 Trees and Graphs/4.6.cpp:39
↓ 1 callersFunctionfirst_ancestor2
Solutions/Chapter 4 Trees and Graphs/4.6.cpp:70
↓ 1 callersFunctionget
Solutions/Chapter 5 Bit Manipulation/5.7.cpp:16
↓ 1 callersFunctionget1
Solutions/Chapter 5 Bit Manipulation/5.7.cpp:39
↓ 1 callersFunctiongetDepth
Solutions/Chapter 4 Trees and Graphs/4.1.cpp:43
↓ 1 callersFunctionget_absent_int
* @brief Finds a missing integer among the n given integers using a histogram. * @note Complexity: O(n) in time, O(1) in space. * @note This funct
Solutions/Chapter 12 System Design and Memory Limits/12.3.cpp:21
↓ 1 callersFunctionget_distance_one_words
* @brief Returns an array containing all words in a given dictionary with * distance one from a given word. * @note Complexity: O(d) in bot
Solutions/Chapter 20 Hard/20.10.cpp:51
↓ 1 callersFunctionget_duplicates
* @brief Returns a bitset indicating which numbers in an array of size n are * duplicates, where the array numbers are in the range [0,32000)
Solutions/Chapter 12 System Design and Memory Limits/12.4.cpp:25
↓ 1 callersFunctionget_m_largest_1
* @brief Returns the m largest elements of an array using quick-select. * @note Complexity: O(m) in time (on average), O(n) in space, where n is the
Solutions/Chapter 20 Hard/20.6.cpp:17
↓ 1 callersFunctionget_m_largest_2
* @brief Returns the m largest elements of an array using a min-heap. * @note Complexity: O(n*log(m)) in time, O(m) in space, where n is the number
Solutions/Chapter 20 Hard/20.6.cpp:89
↓ 1 callersFunctionget_m_largest_3
* @brief Returns the m largest elements of an array by sorting it first. * @note Complexity: O(n*log(n)) in time (on average), O(n) in space, where
Solutions/Chapter 20 Hard/20.6.cpp:119
↓ 1 callersFunctionget_path
Solutions/Chapter 8 Recursion/8.2.cpp:36
↓ 1 callersFunctionget_path_between_words
* @brief Determines a path between word1 and word2 which defines a series of * steps to transform word1 into word2 such that each step involv
Solutions/Chapter 20 Hard/20.10.cpp:99
↓ 1 callersFunctionget_subsets
Solutions/Chapter 8 Recursion/8.3.cpp:11
↓ 1 callersFunctionget_subsets1
Solutions/Chapter 8 Recursion/8.3.cpp:33
↓ 1 callersFunctionhanoi
Solutions/Chapter 3 Stacks and Queues/3.4.cpp:29
↓ 1 callersFunctioninit
Solutions/Chapter 2 Linked Lists/2.1.cpp:19
↓ 1 callersFunctioninit
Solutions/Chapter 2 Linked Lists/2.3.cpp:16
↓ 1 callersFunctioninit
Solutions/Chapter 2 Linked Lists/2.2.cpp:14
↓ 1 callersFunctioninit
Solutions/Chapter 2 Linked Lists/2.5.cpp:20
↓ 1 callersFunctioninit
Solutions/Chapter 4 Trees and Graphs/4.8.cpp:21
↓ 1 callersFunctioninit
Solutions/Chapter 4 Trees and Graphs/4.6.cpp:21
↓ 1 callersFunctioninit
Solutions/Chapter 4 Trees and Graphs/4.4.cpp:21
↓ 1 callersFunctioninit
Solutions/Chapter 4 Trees and Graphs/BST.cpp:15
↓ 1 callersFunctioninit
Solutions/Chapter 4 Trees and Graphs/4.3.cpp:20
↓ 1 callersFunctioninit
Solutions/Chapter 4 Trees and Graphs/4.1.cpp:21
↓ 1 callersFunctioninit
Solutions/Chapter 4 Trees and Graphs/4.5.cpp:18
↓ 1 callersFunctioninit
Solutions/Chapter 4 Trees and Graphs/4.2.cpp:19
↓ 1 callersFunctioninit
Solutions/Chapter 4 Trees and Graphs/4.7.cpp:19
↓ 1 callersFunctioninorderTraver
Solutions/Chapter 4 Trees and Graphs/BST.cpp:35
↓ 1 callersFunctioninsert
Solutions/Chapter 4 Trees and Graphs/4.1.cpp:27
↓ 1 callersMethodinsert
* @brief Inserts a word into the dictionary. * @note Complexity: O(n²) in both time and space, where n is the length * of the word.
Solutions/Chapter 20 Hard/20.13.cpp:37
↓ 1 callersMethodinsert
Solutions/Chapter 20 Hard/ac_automation.cpp:33
↓ 1 callersFunctionisAnagram
Solutions/Chapter 1 Arrays and Strings/1.4.cpp:21
↓ 1 callersFunctionisBalance
Solutions/Chapter 4 Trees and Graphs/4.1.cpp:53
↓ 1 callersFunctionisRotation
Solutions/Chapter 1 Arrays and Strings/1.8.cpp:17
↓ 1 callersFunctionisSubstring
Solutions/Chapter 1 Arrays and Strings/1.8.cpp:11
↓ 1 callersFunctionis_distance_one
* @brief Returns true if two words word1 and word2 have the same length and * differ by exactly one character, false otherwise. * @note Com
Solutions/Chapter 20 Hard/20.10.cpp:29
↓ 1 callersFunctionis_valid
* @brief Returns true if n is an integer whose prime factors are only 3, 5 * and 7, false otherwise. * @note Complexity: O(log(n)) in time,
Solutions/Chapter 10 Mathematical/10.7.cpp:121
↓ 1 callersFunctionis_valid_rectangle
* @brief Returns true if the rectangle rows and columns form words in the given * dictionary, false otherwise. * @note Complexity: O(width*
Solutions/Chapter 20 Hard/20.13.cpp:378
↓ 1 callersMethodlargest_word_length
* @brief Returns the length of the longest word in the dictionary. * @note Complexity: O(1) in both time and space. */
Solutions/Chapter 20 Hard/20.13.cpp:95
↓ 1 callersFunctionline_crosses_most_points_1
* @brief Determines the line which crosses the largest number of points using * brute-force (build all possible lines and then determine whic
Solutions/Chapter 10 Mathematical/10.6.cpp:41
↓ 1 callersFunctionline_crosses_most_points_2
* @brief Determines the line which crosses the largest number of points using * sorting (build all possible lines, sort them and then determi
Solutions/Chapter 10 Mathematical/10.6.cpp:110
↓ 1 callersFunctionlis
Solutions/Chapter 9 Sorting and Searching/9.7.cpp:27
↓ 1 callersFunctionloopstart1
Solutions/Chapter 2 Linked Lists/2.5.cpp:61
↓ 1 callersFunctionmake_change
Solutions/Chapter 8 Recursion/8.7.cpp:46
↓ 1 callersFunctionmatch
Solutions/Chapter 4 Trees and Graphs/4.7.cpp:36
↓ 1 callersFunctionmerge
Solutions/Chapter 9 Sorting and Searching/9.1.0.cpp:9
↓ 1 callersFunctionmerge
Solutions/Chapter 9 Sorting and Searching/9.1.1.cpp:15
↓ 1 callersFunctionminimal
Solutions/Chapter 4 Trees and Graphs/4.5.cpp:36
↓ 1 callersFunctionmissing
Solutions/Chapter 5 Bit Manipulation/5.7.cpp:23
↓ 1 callersFunctionmissing1
Solutions/Chapter 5 Bit Manipulation/5.7.cpp:47
↓ 1 callersFunctionmultiply
* @brief Computes a*b using only additions. * @note Complexity: O(|a|) in time, O(1) in space. */
Solutions/Chapter 10 Mathematical/10.4.cpp:53
↓ 1 callersFunctionnext
Solutions/Chapter 5 Bit Manipulation/5.3.cpp:27
↓ 1 callersFunctionnext1
Solutions/Chapter 5 Bit Manipulation/5.3.cpp:45
↓ 1 callersFunctionpaint_fill
Solutions/Chapter 8 Recursion/8.6.cpp:16
↓ 1 callersFunctionpath
Solutions/Chapter 8 Recursion/8.2.cpp:22
↓ 1 callersFunctionpath1
Solutions/Chapter 8 Recursion/8.2.cpp:32
↓ 1 callersFunctionpermu1
Solutions/Chapter 8 Recursion/8.4.cpp:34
↓ 1 callersMethodpop
Solutions/Chapter 3 Stacks and Queues/3.1.cpp:23
↓ 1 callersFunctionpow
Solutions/Chapter 8 Recursion/8.1.cpp:40
↓ 1 callersFunctionpredecessor
Solutions/Chapter 4 Trees and Graphs/BST.cpp:76
↓ 1 callersFunctionprevios
Solutions/Chapter 5 Bit Manipulation/5.3.cpp:36
↓ 1 callersFunctionprevious1
Solutions/Chapter 5 Bit Manipulation/5.3.cpp:59
↓ 1 callersFunctionprint
Solutions/Chapter 8 Recursion/8.8.cpp:10
↓ 1 callersFunctionprint
Solutions/Chapter 2 Linked Lists/2.1.cpp:80
↓ 1 callersFunctionprint
Solutions/Chapter 4 Trees and Graphs/4.8.cpp:38
↓ 1 callersFunctionprint
Solutions/Chapter 4 Trees and Graphs/4.4.cpp:62
↓ 1 callersFunctionprint2
Solutions/Chapter 4 Trees and Graphs/4.8.cpp:68
↓ 1 callersFunctionprintLastKLines
Solutions/Chapter 13 CPP/13.1.cpp:10
↓ 1 callersFunctionprint_binary
Solutions/Chapter 5 Bit Manipulation/5.2.cpp:11
↓ 1 callersFunctionprint_pare
Solutions/Chapter 8 Recursion/8.5.cpp:13
↓ 1 callersFunctionprint_paths
Solutions/Chapter 8 Recursion/8.2.cpp:49
↓ 1 callersMethodquery
Solutions/Chapter 20 Hard/ac_automation.cpp:83
↓ 1 callersFunctionrandom_graph
* @brief Generates a random graph with n nodes and returns a pointer to the * first generated node (a root node). * @note Complexity: O(n)
Solutions/Chapter 13 CPP/13.8.cpp:18
↓ 1 callersFunctionrandom_points
* @brief Returns an array with n distinct random points with coordinates (i,j), * where i and j are integer values in [0,9]. * @note This m
Solutions/Chapter 10 Mathematical/10.6.cpp:164
↓ 1 callersFunctionrandom_vector
* @brief Returns a random vector containing n integer values in [0,32000). * @note Complexity: O(n) in both time and space. */
Solutions/Chapter 12 System Design and Memory Limits/12.4.cpp:49
↓ 1 callersFunctionremove
Solutions/Chapter 2 Linked Lists/2.3.cpp:34
↓ 1 callersFunctionremovedulicate1
Solutions/Chapter 2 Linked Lists/2.1.cpp:59
↓ 1 callersMethodreset
* @brief Marks the cell at the i-th row and j-th column as "undefined" * (i.e., sets it to '\0'). * @note Complexity: O(1) in both
Solutions/Chapter 20 Hard/20.13.cpp:154
↓ 1 callersMethodreset
Solutions/Chapter 20 Hard/ac_automation.cpp:26
↓ 1 callersFunctionreverse1
Solutions/Chapter 1 Arrays and Strings/1.2.cpp:23
↓ 1 callersFunctionroute
Solutions/Chapter 4 Trees and Graphs/4.2.cpp:24
← previousnext →101–200 of 382, ranked by callers