MCPcopy Create free account

hub / github.com/ByteByteGoHq/coding-interview-patterns / functions

Functions1,014 in github.com/ByteByteGoHq/coding-interview-patterns

↓ 73 callersMethodadd
kotlin/Heaps/MedianOfAnIntegerStream.kt:7
↓ 54 callersMethodget
(int key)
java/Linked Lists/LRUCache.java:32
↓ 51 callersMethodadd
(int num)
java/Heaps/MedianOfAnIntegerStream.java:14
↓ 36 callersMethodfind
kotlin/Graphs/ConnectTheDots.kt:23
↓ 30 callersMethodAdd
(int num)
csharp/Heaps/MedianOfAnIntegerStream.cs:12
↓ 28 callersMethodput
(int key, int val)
java/Linked Lists/LRUCache.java:45
↓ 25 callersMethodremove
(DoublyLinkedListNode node)
java/Linked Lists/LRUCache.java:70
↓ 18 callersMethodinsert
cpp/Tries/design_a_trie.cpp:26
↓ 14 callersMethodadd
(self, num: int)
python3/Heaps/median_of_an_integer_stream.py:9
↓ 11 callersMethodpeek
()
java/Stacks/ImplementAQueueUsingAStack.java:33
↓ 10 callersMethodEnqueue
(int x)
csharp/Stacks/ImplementAQueueUsingAStack.cs:12
↓ 10 callersMethodinsert
kotlin/Tries/DesignATrie.kt:9
↓ 10 callersMethodpeek
kotlin/Stacks/ImplementAQueueUsingAStack.kt:33
↓ 8 callersMethodDequeue
()
csharp/Stacks/ImplementAQueueUsingAStack.cs:29
↓ 8 callersMethodPeek
()
csharp/Stacks/ImplementAQueueUsingAStack.cs:37
↓ 8 callersFunctionbacktrack
cpp/Backtracking/find_all_subsets.cpp:10
↓ 7 callersMethodcompare
(ListNode self, ListNode other)
java/Heaps/CombineSortedLinkedLists.java:21
↓ 6 callersMethodget
cpp/Linked Lists/lru_cache.cpp:43
↓ 6 callersFunctiongetNextNum
cpp/Fast and Slow Pointers/happy_number.cpp:18
↓ 5 callersFunctiondfs
cpp/Graphs/count_islands.cpp:21
↓ 5 callersFunctionreverse
(s []rune, start int)
go/Two Pointers/next_lexicographical_sequence.go:28
↓ 4 callersMethodcompareTo
(Pair other)
java/Heaps/KMostFrequentStringsMinHeap.java:18
↓ 4 callersMethodswap
(int[] nums, int a, int b)
java/Sort and Search/DutchNationalFlag.java:23
↓ 3 callersMethodfind
(self, x: int)
python3/Graphs/merging_communities.py:19
↓ 3 callersMethodfind
(int x)
java/Graphs/MergingCommunities.java:34
↓ 3 callersFunctiongcd
Kotlin doesn't have a built-in GCD function, so we define one here.
kotlin/Math and Geometry/MaximumCollinearPoints.kt:46
↓ 3 callersFunctiongetNextNum
kotlin/Fast and Slow Pointers/HappyNumber.kt:17
↓ 3 callersFunctiongetNextNum
(x: number)
typescript/Fast and Slow Pointers/happy_number.ts:15
↓ 3 callersMethodgetNextNum
(int x)
java/Fast and Slow Pointers/HappyNumber.java:15
↓ 3 callersFunctionget_next_num
(x: int)
python3/Fast and Slow Pointers/happy_number.py:13
↓ 3 callersMethodremoveNode
(node: DoublyLinkedListNode)
typescript/Linked Lists/lru_cache.ts:66
↓ 3 callersMethodremove_node
(self, node: DoublyLinkedListNode)
python3/Linked Lists/lru_cache.py:50
↓ 3 callersMethodswap
(int[] nums, int a, int b)
java/Sort and Search/SortArrayQuicksortOptimized.java:39
↓ 3 callersMethodswap
(int[] nums, int a, int b)
java/Sort and Search/KthLargestIntegerQuickselect.java:37
↓ 2 callersMethodaddToTail
(node: DoublyLinkedListNode)
typescript/Linked Lists/lru_cache.ts:58
↓ 2 callersMethodaddToTail
(DoublyLinkedListNode node)
java/Linked Lists/LRUCache.java:62
↓ 2 callersMethodadd_to_tail
(self, node: DoublyLinkedListNode)
python3/Linked Lists/lru_cache.py:43
↓ 2 callersFunctioncutsEnoughWood
Determine if the current value of 'H' cuts at least 'k' meters of wood.
cpp/Binary Search/cutting_wood.cpp:22
↓ 2 callersFunctionexpandPalindrome
Expands outward from the center of a base case to identify the start index and length of the longest palindrome that extends from this base case.
kotlin/Dynamic Programming/LongestPalindromeInAStringExpanding.kt:27
↓ 2 callersFunctionexpandPalindrome
Expands outward from the center of a base case to identify the start index and length of the longest palindrome that extends from this base case.
cpp/Dynamic Programming/longest_palindrome_in_a_string_expanding.cpp:34
↓ 2 callersMethodexpandPalindrome
(int left, int right, String s)
java/Dynamic Programming/LongestPalindromeInAStringExpanding.java:34
↓ 2 callersFunctionexpand_palindrome
(left: int, right: int, s: str)
python3/Dynamic Programming/longest_palindrome_in_a_string_expanding.py:24
↓ 2 callersFunctionexploreLevel
This function explores the next level in the level-order traversal and checks if two searches meet.
kotlin/Graphs/ShortestTransformationSequencOptimized.kt:42
↓ 2 callersFunctionexploreLevel
This function explores the next level in the level-order traversal and checks if two searches meet.
cpp/Graphs/shortest_transformation_sequence_optimized.cpp:46
↓ 2 callersMethodexploreLevel
(Queue<String> queue, Set<String> visited, Set<String> otherVisited, Set<String> dictionarySet)
java/Graphs/ShortestTransformationSequenceOptimized.java:49
↓ 2 callersFunctionexplore_level
(queue, visited, other_visited, dictionary_set)
python3/Graphs/shortest_transformation_sequence_optimized.py:35
↓ 2 callersMethodfind
(self, x)
python3/Graphs/connect_the_dots.py:24
↓ 2 callersMethodfind
(int x)
java/Graphs/ConnectTheDots.java:38
↓ 2 callersFunctionfindMiddle
From the 'Linked List Midpoint' problem.
cpp/Linked Lists/palindromic_linked_list.cpp:46
↓ 2 callersMethodget
(self, key: int)
python3/Linked Lists/lru_cache.py:20
↓ 2 callersFunctionisAlnum
(r rune)
go/Two Pointers/is_palindrome_valid.go:28
↓ 2 callersFunctionisAlphaNumeric
(c: string)
typescript/Two Pointers/is_palindrome_valid.ts:20
↓ 2 callersFunctionlowerBoundBinarySearch
cpp/Binary Search/first_and_last_occurrences_of_a_number.cpp:9
↓ 2 callersMethodreverseCharArray
(char[] chars, int start, int end)
java/Two Pointers/NextLexicographicalSequence.java:31
↓ 2 callersFunctionreverseList
From the 'Reverse Linked List' problem.
cpp/Linked Lists/palindromic_linked_list.cpp:33
↓ 2 callersMethodswap
(int[] nums, int a, int b)
java/Sort and Search/SortArrayQuicksort.java:37
↓ 2 callersMethodtransferEnqueueToDequeue
()
java/Stacks/ImplementAQueueUsingAStack.java:16
↓ 2 callersMethodtransfer_enqueue_to_dequeue
(self)
python3/Stacks/implement_a_queue_using_a_stack.py:9
↓ 2 callersFunctionupperBoundBinarySearch
cpp/Binary Search/first_and_last_occurrences_of_a_number.cpp:24
↓ 1 callersMethodCompareTo
(Pair other)
csharp/Heaps/KMostFrequentStringsMaxHeap.cs:12
↓ 1 callersFunctionbacktrack
kotlin/Backtracking/PhoneKeypadCombinations.kt:17
↓ 1 callersFunctionbacktrack
kotlin/Backtracking/FindAllSubsets.kt:7
↓ 1 callersFunctionbacktrack
kotlin/Backtracking/FindAllPermutations.kt:7
↓ 1 callersFunctionbacktrack
cpp/Backtracking/phone_keypad_combinations.cpp:18
↓ 1 callersFunctionbacktrack
cpp/Backtracking/find_all_permutations.cpp:12
↓ 1 callersFunctionbacktrack
(nums: List[int], candidate: List[int], used: Set[int], res: List[List[int]])
python3/Backtracking/find_all_permutations.py:9
↓ 1 callersFunctionbacktrack
(i: int, curr_subset: List[int], nums: List[int], res: List[List[int]])
python3/Backtracking/find_all_subsets.py:9
↓ 1 callersFunctionbacktrack
(i: int, curr_combination: List[str], digits: str, keypad_map: Dict[str, str], res: List[str])
python3/Backtracking/phone_keypad_combinations.py:13
↓ 1 callersMethodbacktrack
(int[] nums, List<Integer> candidate, Set<Integer> used, List<List<Integer>> res)
java/Backtracking/FindAllPermutations.java:13
↓ 1 callersMethodbacktrack
(int i, List<Integer> currSubset, int[] nums, List<List<Integer>> res)
java/Backtracking/FindAllSubsets.java:11
↓ 1 callersMethodbacktrack
(int i, List<Character> currCombination, String digits, Map<Character, String> keypadMap, List<String> result)
java/Backtracking/PhoneKeypadCombinations.java:22
↓ 1 callersFunctionbuildSubtree
kotlin/Trees/BuildBinaryTree.kt:24
↓ 1 callersFunctionbuildSubtree
cpp/Trees/build_binary_tree.cpp:28
↓ 1 callersMethodbuildSubtree
(int left, int right, int[] preorder, int[] inorder)
java/Trees/BuildBinaryTree.java:31
↓ 1 callersFunctionbuildTree
Helper function to construct the tree using preorder traversal.
kotlin/Trees/SerializeAndDeserializeABinaryTree.kt:45
↓ 1 callersFunctionbuildTree
Helper function to construct the tree using preorder traversal.
cpp/Trees/serialize_and_deserialize_a_binary_tree.cpp:46
↓ 1 callersMethodbuildTree
(Queue<String> values)
java/Trees/SerializeAndDeserializeABinaryTree.java:51
↓ 1 callersFunctionbuild_subtree
(left: int, right: int, preorder: List[int], inorder: List[int])
python3/Trees/build_binary_tree.py:25
↓ 1 callersFunctionbuild_tree
(values: List[str])
python3/Trees/serialize_and_deserialize_a_binary_tree.py:41
↓ 1 callersFunctionclimbingStairsTopDownHelper
kotlin/Dynamic Programming/ClimbingStairsTopDown.kt:6
↓ 1 callersFunctionclimbingStairsTopDownHelper
cpp/Dynamic Programming/climbing_stairs_top_down.cpp:8
↓ 1 callersMethodcompareFreqs
(int[] windowFreqs, int[] expectedFreqs)
java/Sliding Windows/SubstringAnagrams.java:36
↓ 1 callersFunctioncompareTrees
kotlin/Trees/BinaryTreeSymmetry.kt:20
↓ 1 callersFunctioncompareTrees
cpp/Trees/binary_tree_symmetry.cpp:21
↓ 1 callersMethodcompareTrees
(TreeNode node1, TreeNode node2)
java/Trees/BinaryTreeSymmetry.java:23
↓ 1 callersFunctioncompare_trees
(node1: TreeNode, node2: TreeNode)
python3/Trees/binary_tree_symmetry.py:19
↓ 1 callersFunctioncontains
In the Python code, the while loop checks (current_num +1) in nums. So the helper function 'contains' is needed.
go/Hash Maps and Sets/longest_chain_of_consecutive_numbers_brute_force.go:24
↓ 1 callersFunctioncountSetBits
kotlin/Bit Manipulation/HammingWeightsOfIntegers.kt:5
↓ 1 callersFunctioncountSetBits
cpp/Bit Manipulation/hamming_weights_of_integers.cpp:12
↓ 1 callersMethodcountSetBits
(int x)
java/Bit Manipulation/HammingWeightsOfIntegers.java:10
↓ 1 callersFunctioncount_set_bits
(x: int)
python3/Bit Manipulation/hamming_weights_of_integers.py:7
↓ 1 callersFunctioncutsEnoughWood
Determine if the current value of 'H' cuts at least 'k' meters of wood.
kotlin/Binary Search/CuttingWood.kt:19
↓ 1 callersMethodcutsEnoughWood
(int H, int k, int[] heights)
java/Binary Search/CuttingWood.java:22
↓ 1 callersFunctioncuts_enough_wood
(H: int, k: int, heights: List[int])
python3/Binary Search/cutting_wood.py:18
↓ 1 callersFunctiondfs
kotlin/Graphs/CountIslands.kt:19
↓ 1 callersFunctiondfs
kotlin/Graphs/BipartiteGraphValidation.kt:12
↓ 1 callersFunctiondfs
kotlin/Graphs/LongestIncreasingPath.kt:20
↓ 1 callersFunctiondfs
kotlin/Graphs/GraphDeepCopy.kt:18
↓ 1 callersFunctiondfs
kotlin/Backtracking/NQueens.kt:8
↓ 1 callersFunctiondfs
kotlin/Backtracking/CombinationsOfSumK.kt:7
next →1–100 of 1,014, ranked by callers