Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MAZHARMIK/Interview_DS_Algo
/ functions
Functions
3,557 in github.com/MAZHARMIK/Interview_DS_Algo
⨍
Functions
3,557
◇
Types & classes
1,501
↓ 4 callers
Method
insert
Trie/Count Prefix and Suffix Pairs I.cpp:72
↓ 4 callers
Function
isSameTree
Tree/Same Tree.cpp:98
↓ 4 callers
Method
isSingle
Graph/Disjoint Set/Remove Max Number of Edges to Keep Graph Fully Traversable.cpp:56
↓ 4 callers
Function
isSubsequence
Checks if sub * k is a subsequence of s
Backtracking/Longest Subsequence Repeated k Times.cpp:257
↓ 4 callers
Function
isVowel
strings/Determine if String Halves Are Alike.cpp:80
↓ 4 callers
Function
isVowel
strings/Count Beautiful Substrings II.cpp:93
↓ 4 callers
Function
lowerBound
Helper for binary search (lower_bound equivalent)
DP/1-D DP/Maximum Total Damage With Spell Casting.cpp:191
↓ 4 callers
Function
mergeTwoLists
Function to merge two linked lists in sorted order
Linked List/Flattening a Linked List.cpp:14
↓ 4 callers
Function
predecessor
DP/LIS & Variants/Longest String Chain.cpp:21
↓ 4 callers
Method
query
Heap/Maximum Total Subarray Value II.cpp:67
↓ 4 callers
Function
querySegTree
Segment Tree/Block Placement Queries.cpp:212
↓ 4 callers
Function
querySegmentTree
Segment Tree/Range Sum Query - Mutable.cpp:190
↓ 4 callers
Function
rangeSumBST
Tree/BST/Range Sum of BST.cpp:37
↓ 4 callers
Method
searchPrefix
Trie/Count Prefix and Suffix Pairs I.cpp:84
↓ 4 callers
Function
setBit
Bit_Magic/Minimize XOR.cpp:163
↓ 4 callers
Function
solve
strings/Move Pieces to Obtain a String.cpp:109
↓ 4 callers
Function
solve
strings/Remove Duplicate Letters.cpp:257
↓ 4 callers
Function
solve
DP/Painting the Walls.cpp:60
↓ 4 callers
Function
solve
DP/Interleaving String.cpp:14
↓ 4 callers
Function
solve
DP/Extra Characters in a String.cpp:90
↓ 4 callers
Function
solve
DP/Merge Operations for Minimum Travel Time.cpp:108
↓ 4 callers
Function
solve
DP/Decode Ways.cpp:147
↓ 4 callers
Function
solve
DP/Unique Binary Search Trees II.cpp:68
↓ 4 callers
Function
solve
DP/DP on Grids/Maximum Path Score in a Grid.cpp:176
↓ 4 callers
Function
solve
DP/LIS & Variants/Maximum Balanced Subsequence Sum.cpp:118
↓ 4 callers
Function
solve
DP/LIS & Variants/Build Array Where You Can Find The Maximum Exactly K Comparisons.cpp:116
↓ 4 callers
Function
solve
Arrays/Cumulative_Sum(Prefix Array)/Minimum Operations to Reduce X to Zero.cpp:119
↓ 4 callers
Function
solve
Tree/Lowest Common Ancestor of Deepest Leaves.cpp:131
↓ 4 callers
Function
solve
Tree/Reverse Odd Levels of Binary Tree.cpp:131
↓ 4 callers
Function
solve
Tree/Amount of Time for Binary Tree to Be Infected.cpp:166
↓ 4 callers
Function
solve
C++ *****************************************************************/ T.C : O(n) S.C : O(n) (Stack recursion space) else it's O(1)
Tree/Foldable Binary Tree.cpp:10
↓ 4 callers
Function
solve
Tree/Count the nodes at distance K from leaf.cpp:140
↓ 4 callers
Method
union
Graph/Disjoint Set/Remove Max Number of Edges to Keep Graph Fully Traversable.cpp:145
↓ 4 callers
Method
union
Graph/Disjoint Set/Maximize Spanning Tree Stability with Upgrades.cpp:182
↓ 4 callers
Function
update
Segment Tree/Range Sum Query - Mutable.cpp:166
↓ 4 callers
Function
updateSegTree
Segment Tree/Range Sum Query - Mutable.cpp:170
↓ 3 callers
Method
Union
Graph/Disjoint Set/Disjoint set (Union-Find-Size).cpp:29
↓ 3 callers
Method
binarySearch
APproach-3 //Binary Search + Memoized (Accepted)
DP/Super Egg Drop.cpp:78
↓ 3 callers
Function
check
Stack/Remove All Occurrences of a Substring.cpp:131
↓ 3 callers
Function
checkLCP
DP/DP on Strings/Find the String with LCP.cpp:251
↓ 3 callers
Function
dfs
Graph/Dijkstra'a Based Problems/Minimum Cost to Make at Least One Valid Path in a Grid.cpp:113
↓ 3 callers
Function
dfs
Graph/BFS_DFS/Minimize the Maximum Edge Weight of Graph.cpp:257
↓ 3 callers
Function
dfs
Arrays/2-D Array/Maximum Number of Points From Grid Queries.cpp:224
↓ 3 callers
Function
doubleUtil
Linked List/Double a Number Represented as a Linked List.cpp:223
↓ 3 callers
Function
findPower
Binary exponentiation
DP/DP on Strings/Count Number of Balanced Permutations.cpp:199
↓ 3 callers
Function
findSequences
Backtracking/Letter Tile Possibilities.cpp:126
↓ 3 callers
Function
generateColumnStates
Recursively generate all valid column colorings of height 'm' such that no two vertically adjacent cells have the same color
DP/Painting a Grid With Three Different Colors.cpp:97
↓ 3 callers
Function
getBits
Bit_Magic/Maximum Number That Sum of the Prices Is Less Than or Equal to K.cpp:183
↓ 3 callers
Method
hasNext
This is always called before next()
Design/Flatten Nested List Iterator.cpp:32
↓ 3 callers
Function
insertAtBottom
Recursion/Reverse a Stack.cpp:112
↓ 3 callers
Function
isMatch
Recursion/Regular Expression Matching.cpp:84
↓ 3 callers
Method
next
Stack/Online Stock Span.cpp:16
↓ 3 callers
Method
reverse
Stack/Reverse Substrings Between Each Pair of Parentheses.cpp:96
↓ 3 callers
Function
reverseHelp
Linked List/Reverse Linked List.cpp:108
↓ 3 callers
Function
reverseList
Linked List/Palindrome Linked List.cpp:189
↓ 3 callers
Function
sieve
Mathematical/Segmented Sieve.cpp:9
↓ 3 callers
Function
solve
DP/Partition Array for Maximum Sum.cpp:85
↓ 3 callers
Function
solve
DP/Number of Dice Rolls With Target Sum.cpp:86
↓ 3 callers
Function
solve
DP/Knight Dialer.cpp:139
↓ 3 callers
Function
solve
DP/Minimum Difficulty of a Job Schedule.cpp:119
↓ 3 callers
Function
solve
DP/Painting a Grid With Three Different Colors.cpp:110
↓ 3 callers
Function
solve
DP/DP on Strings/Count Number of Balanced Permutations.cpp:213
↓ 3 callers
Function
solve
DP/DP on Grids/Number of Ways to Paint N × 3 Grid.cpp:86
↓ 3 callers
Function
solve
Linked List/Palindrome Linked List.cpp:275
↓ 3 callers
Function
solve
Linked List/Reorder List.cpp:192
↓ 3 callers
Function
solve
Backtracking/Palindrome Partitioning.cpp:172
↓ 2 callers
Function
FloydWarshall
Graph/Floyd Warshall/Minimum Cost to Convert String I.cpp:68
↓ 2 callers
Method
Union
Graph/Disjoint Set/Greatest Common Divisor Traversal.cpp:36
↓ 2 callers
Method
add
Design/Finding Pairs With a Certain Sum.cpp:26
↓ 2 callers
Method
addAll
Design/Flatten Nested List Iterator.cpp:99
↓ 2 callers
Function
apnaLowerB
Arrays/Leetcode Easy/Maximum Count of Positive Integer and Negative Integer.cpp:82
↓ 2 callers
Function
bestStartingPoint
strings/Find the Lexicographically Largest String From the Box I.cpp:113
↓ 2 callers
Function
bfs
Graph/Redundant Connection.cpp:228
↓ 2 callers
Function
bfs
Graph/Number of Islands.cpp:171
↓ 2 callers
Function
bfs
Graph/Dijkstra'a Based Problems/Shortest Distance After Road Addition Queries I.cpp:195
↓ 2 callers
Function
bfs
Arrays/Find All Groups of Farmland.cpp:245
↓ 2 callers
Function
binarySearch
Arrays/Leetcode Easy/Minimum Common Value.cpp:116
↓ 2 callers
Function
binarySearch
Arrays/Leetcode Easy/Intersection of Two Arrays.cpp:205
↓ 2 callers
Function
buildAnswer
Arrays/2-D Array/Get Biggest Three Rhombus Sums in a Grid.cpp:293
↓ 2 callers
Function
buildSet
Mathematical/Reordered Power of 2.cpp:167
↓ 2 callers
Function
canCross
DP/Frog Jump.cpp:40
↓ 2 callers
Function
canDistr
Arrays/Binary Search/Maximum Candies Allocated to K Children.cpp:142
↓ 2 callers
Function
check
Arrays/Cumulative_Sum(Prefix Array)/Maximum Side Length of a Square with Sum Less than or Equal to Threshold.cpp:184
↓ 2 callers
Function
checkAnagram
strings/Easy Tagged/Find Resultant Array After Removing Anagrams.cpp:60
↓ 2 callers
Method
compareTo
Graph/Dijkstra'a Based Problems/Find Minimum Time to Reach Last Room II.cpp:82
↓ 2 callers
Function
computeLPS
strings/Find Beautiful Indices in the Given Array I.cpp:107
↓ 2 callers
Function
computeLPS
strings/Find Beautiful Indices in the Given Array II.cpp:109
↓ 2 callers
Function
computeLPS
Function to compute the LPS (Longest Proper Prefix which is also Suffix) array
strings/Shortest Palindrome.cpp:109
↓ 2 callers
Function
constructSegmentTree
Segment Tree/Block Placement Queries.cpp:191
↓ 2 callers
Function
construstResult
JAVA ************************************************/ Approach (Using trie) T.C : O(N * L * ClogC), N = total Paths, L = average length of each path,
Trie/Delete Duplicate Folders in System.cpp:115
↓ 2 callers
Function
countSteps
Graph/Dijkstra'a Based Problems/Freedom Trail.cpp:75
↓ 2 callers
Function
dijkstra
Graph/Dijkstra'a Based Problems/Minimum Cost to Convert String I.cpp:86
↓ 2 callers
Function
find
Graph/Disjoint Set/Disjoint set (Union-Find-Rank&PathCompression).cpp:10
↓ 2 callers
Function
findBest
Sliding Window/Frequency of the Most Frequent Element.cpp:133
↓ 2 callers
Function
firstOccur
Arrays/Element Appearing More Than 25% In Sorted Array.cpp:178
↓ 2 callers
Function
get1D
Arrays/Binary Search/Maximize the Distance Between Points on a Square.cpp:219
↓ 2 callers
Function
getCountNumber
Mathematical/Reordered Power of 2.cpp:219
↓ 2 callers
Function
getFinalWord
strings/Text Justification.cpp:13
↓ 2 callers
Function
getLeftMax
Arrays/Trapping Rain Water (without stack).cpp:50
↓ 2 callers
Method
getMaxFishCount
Graph/Disjoint Set/Maximum Number of Fish in a Grid.cpp:58
← previous
next →
201–300 of 3,557, ranked by callers