MCPcopy Create free account

hub / github.com/MAZHARMIK/Interview_DS_Algo / functions

Functions3,557 in github.com/MAZHARMIK/Interview_DS_Algo

↓ 2 callersFunctiongetNSL
Stack/Sum of Subarray Minimums.cpp:167
↓ 2 callersFunctiongetNSR
Stack/Sum of Subarray Minimums.cpp:183
↓ 2 callersFunctiongetNode
Trie/Counting Words With a Given Prefix.cpp:36
↓ 2 callersFunctiongetPrice
Define a long long type in Java
Bit_Magic/Maximum Number That Sum of the Prices Is Less Than or Equal to K.cpp:123
↓ 2 callersFunctiongetRightMax
Arrays/Trapping Rain Water (without stack).cpp:59
↓ 2 callersFunctionhasCommon
DP/Maximum Length of a Concatenated String with Unique Characters.cpp:76
↓ 2 callersFunctioninsert
Bit_Magic/Maximum XOR of Two Numbers in an Array.cpp:83
↓ 2 callersMethodinsert
Trie/Counting Words With a Given Prefix.cpp:55
↓ 2 callersFunctioninsertInSet
Insert updated pair
Sliding Window/Find X-Sum of All K-Long Subarrays II.cpp:132
↓ 2 callersFunctionisGood
Arrays/Leetcode Easy/Check if Array is Good.cpp:122
↓ 2 callersFunctionisPrime
Mathematical/Closest Prime Numbers in Range.cpp:160
↓ 2 callersFunctionisVowel
strings/Count Beautiful Substrings I.cpp:48
↓ 2 callersFunctionkInversePairs
DP/K Inverse Pairs Array.cpp:211
↓ 2 callersFunctionkthCharacter
strings/Easy Tagged/Find the K-th Character in String Game I.cpp:73
↓ 2 callersFunctionkthGrammar
Recursion/K-th Symbol in Grammar.cpp:34
↓ 2 callersFunctionlastOccur
Arrays/Element Appearing More Than 25% In Sorted Array.cpp:197
↓ 2 callersFunctionlengthLinkedList
Linked List/Remove Nth Node From End of List.cpp:86
↓ 2 callersFunctionlis
DP/LIS & Variants/Longest Increasing Subsequence.cpp:17
↓ 2 callersFunctionlongestPrefixSuffix
Arrays/Number of Subarrays That Match a Pattern I and II.cpp:164
↓ 2 callersFunctionlowerBound
Custom implementation of lower bound
Arrays/Leetcode Easy/Special Array With X Elements Greater Than or Equal X.cpp:160
↓ 2 callersMethodmaxSize
Graph/Disjoint Set/Greatest Common Divisor Traversal.cpp:57
↓ 2 callersFunctionmaxXor
Bit_Magic/Maximum XOR of Two Numbers in an Array.cpp:106
↓ 2 callersMethodmerge
Recursion/Merge Sort.cpp:15
↓ 2 callersFunctionminKey
Approach-2 :Without using Priority_queue
Graph/Minimum Spanning Tree (Prim's).cpp:53
↓ 2 callersFunctionnCr
Compute nCr % MOD
DP/Digit DP/Find Sum of Array Product of Magical Sequences.cpp:209
↓ 2 callersMethodnext
Design/Flatten Nested List Iterator.cpp:24
↓ 2 callersFunctionoperate
Stack/Evaluate Reverse Polish Notation.cpp:92
↓ 2 callersFunctionpartition_algo
Heap/Kth Largest Element in an Array.cpp:141
↓ 2 callersMethodpop
Removes the element on top of the stack and returns that element. */
Design/Implement Stack using Queues.cpp:27
↓ 2 callersFunctionpossibleToPlace
Arrays/Binary Search/Magnetic Force Between Two Balls.cpp:67
↓ 2 callersFunctionpreprocess
Preprocess to mark prerequisites for each node
Graph/Topological Sorting/Course Schedule IV.cpp:254
↓ 2 callersFunctionremoveFromSet
Sliding Window/Find X-Sum of All K-Long Subarrays II.cpp:125
↓ 2 callersFunctionreverseRow
Helper method to reverse a row
Arrays/2-D Array/Rotating the Box.cpp:219
↓ 2 callersFunctionsearchKMP
strings/Easy Tagged/String Matching in an Array.cpp:175
↓ 2 callersMethodsearchPrefixCount
Trie/Counting Words With a Given Prefix.cpp:70
↓ 2 callersMethodsetSize
Graph/Disjoint Set/Maximum Number of Fish in a Grid.cpp:54
↓ 2 callersFunctionsolve
DP/Check if There is a Valid Partition For The Array.cpp:15
↓ 2 callersFunctionsortFunc
Sorting to give priority to the char which has the highest frequency Because I would want it to come first in any button (key)
HashMap/Minimum Number of Pushes to Type Word II.cpp:96
↓ 2 callersMethodstartsWith
Returns if there is any word in the trie that starts with the given prefix. */
Trie/Implement Trie (Prefix Tree).cpp:69
↓ 2 callersFunctionsubsetSum
DP/Partition Equal Subset Sum.cpp:166
↓ 2 callersFunctiontree2str
Recursion/Construct String from Binary Tree.cpp:40
↓ 2 callersFunctionunion
Graph/BFS_DFS/Making A Large Island.cpp:500
↓ 2 callersMethodunion
Graph/Disjoint Set/Greatest Common Divisor Traversal.cpp:128
↓ 2 callersFunctionunsetBit
Bit_Magic/Minimize XOR.cpp:167
↓ 1 callersFunctionKadanesAlgo
DP/Maximum Sum Rectangular Submatrix in Matrix dynamic programming(2-D kadane).cpp:17
↓ 1 callersFunctionLCSubstring
DP/Print the Longest Common Substring.cpp:11
↓ 1 callersMethodUnion
Graph/Redundant Connection.cpp:135
↓ 1 callersMethodUnion
Graph/BFS_DFS/Making A Large Island.cpp:216
↓ 1 callersMethodUnion
this is the trick, we return size of group after uniting the nodes in a group Union by rank compression
Graph/Disjoint Set/Max Area of Island.cpp:35
↓ 1 callersMethodUnion
Graph/Disjoint Set/Maximum Number of Fish in a Grid.cpp:37
↓ 1 callersMethodUnion
Graph/Disjoint Set/Count the Number of Complete Components.cpp:142
↓ 1 callersFunctionbinarySearch
DP/LIS & Variants/Longest Increasing Subsequence.cpp:255
↓ 1 callersFunctionbinarySearchLowerBound
Arrays/Binary Search/Number of Flowers in Full Bloom.cpp:153
↓ 1 callersFunctionbinarySearchUpperBound
Arrays/Binary Search/Number of Flowers in Full Bloom.cpp:134
↓ 1 callersFunctionbottomUp1
DP/Decode Ways.cpp:183
↓ 1 callersFunctionbottomUp2
DP/Decode Ways.cpp:213
↓ 1 callersFunctioncomparator
Arrays/Sort Array By Parity.cpp:67
↓ 1 callersFunctioncomparePairs
Helper comparison to mimic pair comparison from C++
Sliding Window/Find X-Sum of All K-Long Subarrays II.cpp:196
↓ 1 callersMethodcompareTo
Design/Design Movie Rental System.cpp:120
↓ 1 callersFunctioncountOperations
Mathematical/Leetcode Easy/Count Operations to Obtain Zero.cpp:82
↓ 1 callersFunctioncreateUtil
Tree/Construct_Binary_Tree_from_Parent_Array.cpp:6
↓ 1 callersFunctioncutRod_bottom_up_I
Unbounded Knapsack (Bottom Up)
DP/Cutting_a_Rod.cpp:40
↓ 1 callersFunctioncutRod_bottom_up_II
Bottom UP
DP/Cutting_a_Rod.cpp:64
↓ 1 callersFunctioncutRod_memoization_I
Memoized Approach (Top Down)
DP/Cutting_a_Rod.cpp:11
↓ 1 callersFunctioncutRod_memoization_II
Memoized Approach (Top Down) - Just Like 0/1 Unbounded Knapsack
DP/Cutting_a_Rod.cpp:26
↓ 1 callersFunctiondfs
HashMap/Restore the Array From Adjacent Pairs.cpp:85
↓ 1 callersFunctiondiagonalPrint
Tree/Diagonal Tree Traversal (Recursive: using map).cpp:32
↓ 1 callersFunctiondiagonalUtil
Tree/Diagonal Tree Traversal (Recursive: using map).cpp:23
↓ 1 callersMethodfind
Graph/BFS_DFS/Power Grid Maintenance.cpp:409
↓ 1 callersMethodfind
Greedy/Minimum Domino Rotations For Equal Row.cpp:16
↓ 1 callersMethodfindMaximumXOR
Bit_Magic/Maximum XOR of Two Numbers in an Array.cpp:63
↓ 1 callersFunctionfindUpperBound
Arrays/Intervals_Based_Qn/Maximum Beauty of an Array After Applying Operation.cpp:143
↓ 1 callersMethodgetAncestors
Graph/All Ancestors of a Node in a Directed Acyclic Graph.cpp:27
↓ 1 callersMethodgetGroupSize
Graph/Disjoint Set/Max Area of Island.cpp:58
↓ 1 callersMethodgetValue
Heap/Maximum Total Subarray Value II.cpp:76
↓ 1 callersMethodinsert
Trie/Find the Length of the Longest Common Prefix.cpp:65
↓ 1 callersFunctioninsertGreatestCommonDivisors
Linked List/Insert Greatest Common Divisors in Linked List.cpp:118
↓ 1 callersFunctionisCycleUtil
Graph/Detect cycle in an undirected graph (DFS).cpp:6
↓ 1 callersFunctionisCyclicUtil
Using Parent vector
Graph/Detect cycle in an undirected graph (BFS).cpp:51
↓ 1 callersFunctionisPalindrome
strings/Easy Tagged/Find First Palindromic String in the Array.cpp:81
↓ 1 callersFunctionisPowerOfThree
Mathematical/Leetcode Easy/Power of Three.cpp:15
↓ 1 callersFunctionisPowerOfTwo
Bit_Magic/Leetcode Easy/Power of Two.cpp:55
↓ 1 callersFunctionisReachableAtTime
Mathematical/Determine if a Cell Is Reachable at a Given Time.cpp:58
↓ 1 callersMethodisReachableAtTime
Mathematical/Determine if a Cell Is Reachable at a Given Time.cpp:13
↓ 1 callersFunctionisSubsequence
strings/Is Subsequence.cpp:74
↓ 1 callersFunctionisUnSet
Bit_Magic/Minimize XOR.cpp:171
↓ 1 callersFunctionlis
DP/LIS & Variants/Maximum Length of Pair Chain.cpp:21
↓ 1 callersFunctionlowerBound
Function to find the lower_bound of an element in a sorted list
strings/Find Beautiful Indices in the Given Array I.cpp:165
↓ 1 callersFunctionlowerBound
Function to find the lower_bound of an element in a sorted list
strings/Find Beautiful Indices in the Given Array II.cpp:167
↓ 1 callersFunctionlowerBound
Custom lower_bound (first index >= target)
Arrays/Binary Search/Maximize the Distance Between Points on a Square.cpp:259
↓ 1 callersFunctionmaxLength
DP/Maximum Length of a Concatenated String with Unique Characters.cpp:72
↓ 1 callersFunctionmaxScoreUtilBottomUp
DP/Jump Game VI.cpp:49
↓ 1 callersFunctionmaxSeg1
APPROACH-1 (Using Simple Maths)
DP/Maximize The Cut Segments (5 approaches).cpp:12
↓ 1 callersFunctionmaxSeg2
APPROACH-2 (Usin concept of Coin Change)
DP/Maximize The Cut Segments (5 approaches).cpp:30
↓ 1 callersFunctionmaxSeg3
APPROACH-3 (Bottom Up DP)
DP/Maximize The Cut Segments (5 approaches).cpp:60
↓ 1 callersFunctionmaxSeg4
APPROACH-4 (Using recursion with Memoization)
DP/Maximize The Cut Segments (5 approaches).cpp:78
↓ 1 callersFunctionmaxSeg5
APPROACH-5 (Using concept of Rod Cutting)
DP/Maximize The Cut Segments (5 approaches).cpp:93
↓ 1 callersMethodmerge
Arrays/Intervals_Based_Qn/Merge Intervals.cpp:15
↓ 1 callersFunctionmergeNodes
Linked List/Merge Nodes in Between Zeros.cpp:93
↓ 1 callersFunctionnext
Design/Flatten Nested List Iterator.cpp:140
← previousnext →301–400 of 3,557, ranked by callers