Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/careercup/CtCI-6th-Edition-cpp
/ functions
Functions
434 in github.com/careercup/CtCI-6th-Edition-cpp
⨍
Functions
434
◇
Types & classes
73
↓ 1 callers
Function
add_followup
* [add_followup - adding list such that 1's digit is at tail( follow up part of question) * @param list1 * @param list2 * @return list3 represent
chapter-2-Linked-Lists/2-5-add-lists.cpp:194
↓ 1 callers
Function
add_followup_helper
chapter-2-Linked-Lists/2-5-add-lists.cpp:173
↓ 1 callers
Function
add_iterative
* [add_iterative iterative approach to add two given lists] * @param list1 * @param list2 * @return list3 */
chapter-2-Linked-Lists/2-5-add-lists.cpp:59
↓ 1 callers
Function
add_recursive
* [add_recursive - recursive addititon of two lists * @param list1 * @param list2 * @param carry * @return list3 */
chapter-2-Linked-Lists/2-5-add-lists.cpp:121
↓ 1 callers
Function
anagram_check
Chapter-10-Sorting-and-Searching/10-2-Group-Anagrams/10-2-Group-Anagrams.cpp:15
↓ 1 callers
Function
binarySearch
chapter-8-recursion-and-Dynamic-Programming/8.3_Magic_Index.cpp:6
↓ 1 callers
Function
binaryToStringDiv
Ch 5. Bit Manipulation/C++14/5.2-BinaryToString.cpp:41
↓ 1 callers
Function
binaryToStringMul
Ch 5. Bit Manipulation/C++14/5.2-BinaryToString.cpp:12
↓ 1 callers
Function
buildCharFrequencyTable
Ch 1.Arrays And Strings/3.Palindrome Permutation/Palindrome Permutation.cpp:24
↓ 1 callers
Function
buildOrder
Ch 4. Trees and Graphs/C++14/4.7d-BuildOrder.cpp:49
↓ 1 callers
Function
buildOrder
Ch 4. Trees and Graphs/C++14/4.7-BuildOrder.cpp:17
↓ 1 callers
Function
buildProject
Ch 4. Trees and Graphs/C++14/4.7d-BuildOrder.cpp:24
↓ 1 callers
Function
checkMaxOneOdd
Ch 1.Arrays And Strings/3.Palindrome Permutation/Palindrome Permutation.cpp:36
↓ 1 callers
Function
cntways
chapter-8-recursion-and-Dynamic-Programming/8.2_Grid_Paths.cpp:5
↓ 1 callers
Function
commonAncestor
We travel down to see where is the divergent point such that two query nodes are NOT in the same branch*/
Chapter-4-tree-and-graph/4.8_first_common_ancestor.cpp:34
↓ 1 callers
Function
compress
Ch 1.Arrays And Strings/6.String_Compression/6.string_compression.cpp:12
↓ 1 callers
Function
countFrequency
Ch 1.Arrays And Strings/4.Palindrome_Permutation/4-pallindrome-permutations.cpp:43
↓ 1 callers
Function
countPathsWithSum
Ch 4. Trees and Graphs/C++14/4.12-PathsWithSum.cpp:36
↓ 1 callers
Function
countWays
chapter-8-recursion-and-Dynamic-Programming/8-1-Triple-Step.cpp:6
↓ 1 callers
Function
countWays
A recursive function used by countWays
chapter-8-recursion-and-Dynamic-Programming/8.1_Triple_Step.cpp:7
↓ 1 callers
Function
countWordFreq
Chapter-16-moderate/word_freq.cpp:27
↓ 1 callers
Function
createBst
Chapter-4-tree-and-graph/4.2_minimal_tree.cpp:10
↓ 1 callers
Function
createMatrix
chapter-8-recursion-and-Dynamic-Programming/8-2-Robot-in-a-Grid.cpp:119
↓ 1 callers
Function
createMinimalBST
Ch 4. Trees and Graphs/4-2-Minimal-Tree.cpp:20
↓ 1 callers
Function
createMinimalBst
Chapter-4-tree-and-graph/4.8_first_common_ancestor.cpp:9
↓ 1 callers
Function
createMinimalBst
Chapter-4-tree-and-graph/4.11_random_node.cpp:12
↓ 1 callers
Function
createMinimalBst
Build a BST first, and searching for in-order successor of a given node.*/
Chapter-4-tree-and-graph/4.6_successor.cpp:11
↓ 1 callers
Function
createMinimalBst
Chapter-4-tree-and-graph/4.4_check_balanced.cpp:12
↓ 1 callers
Function
createMinimalBst
Chapter-4-tree-and-graph/4.5_validate_BST.cpp:12
↓ 1 callers
Function
createMinimalBst
Chapter-4-tree-and-graph/4.3_list_of_depths.cpp:13
↓ 1 callers
Function
createMinimalBst
Chapter-4-tree-and-graph/4.9_BST_sequences.cpp:10
↓ 1 callers
Function
crossOff
Ch 6. Math and Logic Puzzles/Intro/SieveOfEratosthenes.cpp:6
↓ 1 callers
Function
deleteList
* [deleteList - delete the entire list] * @param head - head of the list */
chapter-2-Linked-Lists/2-2-kthToLast.cpp:46
↓ 1 callers
Function
deleteNode
* [deleteNode - delete the "node" from the list] * @param node [node to be deleted] */
chapter-2-Linked-Lists/2-3-delete-middle-node.cpp:39
↓ 1 callers
Function
detectAndRemoveCycle
chapter-2-Linked-Lists/2-8-loop-detection.cpp:29
↓ 1 callers
Function
findAllSeq
The crucial point is that root must come before all its children. We do it recursivley, at each level: We first compute all permutations of left s
Chapter-4-tree-and-graph/4.9_BST_sequences.cpp:37
↓ 1 callers
Function
findLevelLinkedLists
Chapter-4-tree-and-graph/4.3_list_of_depths.cpp:28
↓ 1 callers
Function
findMagic
chapter-8-recursion-and-Dynamic-Programming/8-3-Magic-Index.cpp:30
↓ 1 callers
Function
findMagicUtil
chapter-8-recursion-and-Dynamic-Programming/8-3-Magic-Index.cpp:5
↓ 1 callers
Function
findPermutations
chapter-8-recursion-and-Dynamic-Programming/8-8-Permutation-with-dups.cpp:7
↓ 1 callers
Function
findPermutations
chapter-8-recursion-and-Dynamic-Programming/8-7-Permutations-without-Dups.cpp:7
↓ 1 callers
Function
flipToWin
Ch 5. Bit Manipulation/C++14/5.3-FlipBitToWin.cpp:16
↓ 1 callers
Function
floodFill
It mainly finds the previous color on (x, y) and calls floodFillUtil()
chapter-8-recursion-and-Dynamic-Programming/8.10_Paint_Fill.cpp:31
↓ 1 callers
Function
floodFillUtil
A recursive function to replace previous color 'prevC' at '(x, y)' and all surrounding pixels of (x, y) with new color 'newC' and
chapter-8-recursion-and-Dynamic-Programming/8.10_Paint_Fill.cpp:11
↓ 1 callers
Function
getNextPrime
Ch 6. Math and Logic Puzzles/Intro/SieveOfEratosthenes.cpp:14
↓ 1 callers
Function
getPath
Checks if path is valid and simultaneously adds position to a result vector
chapter-8-recursion-and-Dynamic-Programming/8-2-Robot-in-a-Grid.cpp:22
↓ 1 callers
Method
getRundomNode
Ch 4. Trees and Graphs/C++14/4.11-RandomNode.cpp:72
↓ 1 callers
Function
getVolume
Ch 17. Hard/Q17_21_Volume_of_Histogram/histogramVolume.cpp:7
↓ 1 callers
Function
group_anagrams
Chapter-10-Sorting-and-Searching/10-2-Group-Anagrams/10-2-Group-Anagrams.cpp:23
↓ 1 callers
Function
helper_reverse
Ch 1.Arrays And Strings/7.Rotate_matrix/7.rotate_matrix.cpp:23
↓ 1 callers
Function
helper_transpose
Ch 1.Arrays And Strings/7.Rotate_matrix/7.rotate_matrix.cpp:12
↓ 1 callers
Function
init
Ch 6. Math and Logic Puzzles/Intro/SieveOfEratosthenes.cpp:24
↓ 1 callers
Function
insert
chapter-2-Linked-Lists/2-4-partition.cpp:26
↓ 1 callers
Function
insert
* Insert to the head of the list * @param head - Current head of list * @param data - new node's data */
chapter-2-Linked-Lists/2-2-kthToLast.cpp:36
↓ 1 callers
Function
insertion
Ch 5. Bit Manipulation/C++14/5.1-Insertion.cpp:15
↓ 1 callers
Function
intersectionPoint
* [intersectionPoint Returns the point of intersection of two lists] * @param head1 [ head of list 1 ] * @param head2 [ head of list 2 ] * @retur
chapter-2-Linked-Lists/2-7-intersection.cpp:47
↓ 1 callers
Method
isAdjacentFor
Ch 4. Trees and Graphs/C++14/graph.hpp:39
↓ 1 callers
Function
isBST
The check is performed recursively. The min/max solution. We proceed through the tree with this approach. When we branch left, the max gets updated to
Chapter-4-tree-and-graph/4.5_validate_BST.cpp:28
↓ 1 callers
Function
isBalanced
Returns true if binary tree with root as root is height-balanced */
Chapter-4-tree-and-graph/4.4_check_balanced.cpp:28
↓ 1 callers
Function
isExactlyOneBitSet
Ch 1.Arrays And Strings/4.Palindrome_Permutation/4-pallindrome-permutations.cpp:141
↓ 1 callers
Function
isOneAway
Ch 1.Arrays And Strings/5. One Away/5.One Away.cpp:5
↓ 1 callers
Function
isPalindromeIter1
* [isPallindromeIter1 - Iteratively determine if list is palindrome using reversing the list] * @param head [Head node of the list] * @return
chapter-2-Linked-Lists/2-6-palindrome.cpp:71
↓ 1 callers
Function
isPalindromeIter2
chapter-2-Linked-Lists/2-6-palindrome.cpp:122
↓ 1 callers
Function
isPalindromeRecur
chapter-2-Linked-Lists/2-6-palindrome.cpp:196
↓ 1 callers
Function
isPalindromeRecurHelper
chapter-2-Linked-Lists/2-6-palindrome.cpp:175
↓ 1 callers
Function
isRotation
Ch 1.Arrays And Strings/9.String_rotation/9.string_rotation.cpp:17
↓ 1 callers
Function
isUniqueChars
Ch 1.Arrays And Strings/1.Is Unique/1. Is_unique.cpp:9
↓ 1 callers
Function
isUniqueChars_bitvector
Ch 1.Arrays And Strings/1.Is Unique/1. Is_unique.cpp:24
↓ 1 callers
Function
isUniqueChars_noDS
Ch 1.Arrays And Strings/1.Is Unique/1. Is_unique.cpp:37
↓ 1 callers
Function
kthToLastHelper
* [kthToLastHelper - helper routine to find nth node for recursive approach * @param head - head of the list * @param k - the k value for fin
chapter-2-Linked-Lists/2-2-kthToLast.cpp:74
↓ 1 callers
Function
kthToLastIterative
* kthToLastIterative - Iterative approach for finding kth to last element of list. * @param head - head of node * @param k - the k value for
chapter-2-Linked-Lists/2-2-kthToLast.cpp:105
↓ 1 callers
Function
kthToLastRecursive
* kthToLastRecursive - Recursive approach for finding kth to last element of list. * @param head - head of node * @param k - the k value for
chapter-2-Linked-Lists/2-2-kthToLast.cpp:94
↓ 1 callers
Function
leftmost
Chapter-4-tree-and-graph/4.6_successor.cpp:29
↓ 1 callers
Function
merge
Chapter-10-Sorting-and-Searching/10-1-Sorted-Merge/10-1-Sorted-Merge.cpp:13
↓ 1 callers
Function
merge
Ch 10. Sorting and Searching/10.1 - sortedMerge.cpp:13
↓ 1 callers
Function
min_element
chapter-8-recursion-and-Dynamic-Programming/8.8_Permutations_with_Dups.cpp:15
↓ 1 callers
Function
mostLeft
Ch 4. Trees and Graphs/4.6_Successor.cpp:1
↓ 1 callers
Function
multiply
chapter-8-recursion-and-Dynamic-Programming/8-5-Recursive-Multiply.cpp:5
↓ 1 callers
Function
multiply1
chapter-8-recursion-and-Dynamic-Programming/8.5_Recursive_Multiply.cpp:12
↓ 1 callers
Function
multiply2
The second method is the Solution 3 discussed in the book, where division operation is used.*/
chapter-8-recursion-and-Dynamic-Programming/8.5_Recursive_Multiply.cpp:19
↓ 1 callers
Function
nullifyCol
Ch 1.Arrays And Strings/8.Zero_matrix/8.zero_matrix.cpp:20
↓ 1 callers
Function
nullifyMatrix
Ch 1.Arrays And Strings/8.Zero_matrix/8.zero_matrix.cpp:27
↓ 1 callers
Function
partition
We start with a new list. Elements bigger than the pivot element are put at the tail list and elements smaller are put at the head list*/
chapter-2-Linked-Lists/2-4-partition.cpp:50
↓ 1 callers
Function
partition
Ch 1.Arrays And Strings/10.Ouicksort.cpp:14
↓ 1 callers
Function
permute
chapter-8-recursion-and-Dynamic-Programming/8.8_Permutations_with_Dups.cpp:25
↓ 1 callers
Function
permute
Function to print permutations of string This function takes three parameters: 1. String 2. Starting index of the string 3. Ending index o
chapter-8-recursion-and-Dynamic-Programming/8.7_Permutations_without_Dups.cpp:20
↓ 1 callers
Method
pop
Chapter-3-Stacks-and-Queues/3.2_stack_min.cpp:22
↓ 1 callers
Method
pop
Chapter-3-Stacks-and-Queues/C++14/3.2-StackMin.cpp:29
↓ 1 callers
Function
postorder
Chapter-4-tree-and-graph/4.2_minimal_tree.cpp:25
↓ 1 callers
Function
preOrder
Ch 4. Trees and Graphs/4-2-Minimal-Tree.cpp:11
↓ 1 callers
Function
printAllSeq
Chapter-4-tree-and-graph/4.9_BST_sequences.cpp:106
↓ 1 callers
Function
printKlines
Ch 12. C++/print_k_lines.cpp:9
↓ 1 callers
Function
printLevelLinkedLists
Chapter-4-tree-and-graph/4.3_list_of_depths.cpp:48
↓ 1 callers
Function
printList
* printList - Helper routine to print the list * @param head - Current head of the list. */
chapter-2-Linked-Lists/2-2-kthToLast.cpp:59
↓ 1 callers
Function
printParenthesis
Wrapper over _printParenthesis()*/
chapter-8-recursion-and-Dynamic-Programming/8.9_Parens.cpp:9
↓ 1 callers
Function
printPerms
chapter-8-recursion-and-Dynamic-Programming/8-8-Permutation-with-dups-alt.cpp:13
↓ 1 callers
Function
printPowerSet
chapter-8-recursion-and-Dynamic-Programming/8.4_Power_Set.cpp:12
↓ 1 callers
Function
print_all_parentheses
chapter-8-recursion-and-Dynamic-Programming/8-9-parens-alt.cpp:63
↓ 1 callers
Function
print_all_parentheses
chapter-8-recursion-and-Dynamic-Programming/8-9-parens.cpp:20
↓ 1 callers
Function
print_all_parentheses_internal
chapter-8-recursion-and-Dynamic-Programming/8-9-parens-alt.cpp:19
← previous
next →
101–200 of 434, ranked by callers