MCPcopy Create free account

hub / github.com/devweekends/DW-Fellowship-DSA-Roadmap / functions

Functions315 in github.com/devweekends/DW-Fellowship-DSA-Roadmap

Methoddfs
Level 1/Week 12/Graph/695. Max Area of Island/code.cpp:45
Methoddfs
Level 1/Week 12/Graph/133. Clone Graph/code.cpp:53
MethoddiameterOfBinaryTree
Level 0/8 Trees/01. 0543-diameter-of-binary-tree/code.cpp:37
MethodevalRPN
Level 1/Week 06/Stack/150. Evaluate Reverse Polish Notation/code.cpp:25
Functioneven
------------------------------------------ 🔹 Approach 1: Modulo Operator (%) - If a number divided by 2 has no remainder, it is even. - Classic and
Common/Math/Even/even_number.cpp:12
Functioneven_bitwise
------------------------------------------ 🔹 Approach 2: Bitwise AND Operator (&) - Binary trick: even numbers have 0 as the last bit. - Checking (n &
Common/Math/Even/even_number.cpp:24
Functioneven_division
------------------------------------------ 🔹 Approach 3: Integer Division Trick - Divide the number by 2 and multiply it back. - If the result equals
Common/Math/Even/even_number.cpp:36
Functioneven_recursive
------------------------------------------ 🔹 Approach 4: Recursive Method - Subtract 2 recursively until 0 or 1. - Base Case: 0 = even, 1 = odd. - Gre
Common/Math/Even/even_number.cpp:48
Methodexist
Level 1/Week 10/Backtracking/79. Word Search/code.cpp:23
Functionfactorial
Level 1/Week 04/Recursion/Factorial of a Number/code.cpp:21
Functionfib
Level 1/Week 04/Recursion/Fibonacci Number (Nth Term)/code.cpp:27
Methodfib
Main function - using the most optimal approach
Level 1/Week 11/Dynamic Programming/509. Fibonacci Number/code.cpp:64
MethodfibMemo
Approach 2: Memoization (Top-Down DP) Time: O(n), Space: O(n) - memoization table + recursion stack
Level 1/Week 11/Dynamic Programming/509. Fibonacci Number/code.cpp:23
MethodfibMemoHelper
Level 1/Week 11/Dynamic Programming/509. Fibonacci Number/code.cpp:29
MethodfibOptimized
Approach 4: Space Optimization Time: O(n), Space: O(1) - only two variables
Level 1/Week 11/Dynamic Programming/509. Fibonacci Number/code.cpp:52
MethodfibRecursion
Approach 1: Recursion (Brute Force) Time: O(2^n), Space: O(n) - recursion stack
Level 1/Week 11/Dynamic Programming/509. Fibonacci Number/code.cpp:16
MethodfibTabulation
Approach 3: Tabulation (Bottom-Up DP) Time: O(n), Space: O(n) - DP array
Level 1/Week 11/Dynamic Programming/509. Fibonacci Number/code.cpp:39
MethodfindDuplicate
Level 1/Week 02/2 pointers/287. Find the Duplicate Number/code.cpp:16
MethodfindMax
Helper to find the maximum element in the array
Level 0/9 Modified Binary Search/08. 0907-koko-eating-bananas/0907-koko-eating-bananas.cpp:3
MethodfindMax
Level 1/Week 05/Modified Binary Search/875. Koko Eating Bananas/code.cpp:42
MethodfindMaxAverage
Level 1/Week 02/Sliding windows/643. Maximum Average Subarray I/code.cpp:18
MethodfindMaximizedCapital
Level 1/Week 07/K way merge [Heaps]/IPO/code.cpp:21
MethodfindMedian
Level 1/Week 07/K way merge [Heaps]/Find Median from Data Stream/code.cpp:35
MethodfindMedianSortedArrays
Level 1/Week 05/Modified Binary Search/4. Median of Two Sorted Arrays/code.cpp:54
MethodfindMiddle
Helper function to find the middle of the list
Level 1/Week 10/Recursion/148. Sort List/code.cpp:50
MethodfindMin
Level 0/9 Modified Binary Search/03. 0153-find-minimum-in-rotated-sorted-array/0153-find-minimum-in-rotated-sorted-array.cpp:3
MethodfindMin
Level 1/Week 05/Modified Binary Search/153. Find Minimum in Rotated Sorted Array/code.cpp:35
MethodfindOrder
Level 1/Week 12/Graph/210. Course Schedule II/code.cpp:21
MethodfindPeakElement
Level 0/9 Modified Binary Search/06. 0162-find-peak-element/0162-find-peak-element.cpp:3
MethodfindRedundantConnection
Level 1/Week 12/Graph/684. Redundant Connection/code.cpp:21
MethodfourSum
Level 1/Week 02/2 pointers/18. 4Sum/code.cpp:32
MethodgenerateParenthesis
Level 1/Week 06/Stack/22. Generate Parentheses/code.cpp:27
MethodgetMin
Level 1/Week 06/Stack/155. Min Stack/code.cpp:51
MethodgoodNodes
Level 0/8 Trees/06. 1448-count-good-nodes-in-binary-tree/code.cpp:35
MethodgroupAnagrams
Level 1/Week 01/Arrays & Hashing/49. Group Anagrams/code.cpp:26
MethodhasCycle
Level 1/Week 03/LinkedList/141. Linked List Cycle/code.cpp:21
MethodhasCycle
Level 1/Week 12/Graph/210. Course Schedule II/code.cpp:47
MethodhasCycle
Level 1/Week 12/Graph/207. Course Schedule/code.cpp:44
Methodhelper
Level 1/Week 04/Trees/105. Construct Binary Tree from Preorder and Inorder Traversal/code.cpp:47
Methodinorder
Inorder traversal to find kth smallest element
Level 0/8 Trees/08. 0230-kth-smallest-element-in-a-bst/code.cpp:19
Methodinorder
Level 1/Week 04/Trees/230. Kth Smallest Element in a BST/code.cpp:35
Methodinvert
Level 1/Week 04/Trees/226. Invert Binary Tree/code.cpp:28
MethodinvertTree
Level 1/Week 04/Trees/226. Invert Binary Tree/code.cpp:39
MethodisAnagram
Level 1/Week 01/Arrays & Hashing/242. Valid Anagram/code.cpp:24
FunctionisArmstrong
------------------------------------------ 🔹 Approach 1: Iterative with Full If-Else - Extracts each digit - Cubes it and adds to sum - Compares sum t
Common/Math/Armstrog Number/Armstrong.cpp:13
FunctionisArmstrong1
Common/Math/Armstrog Number/Armstrong.cpp:61
FunctionisArmstrong2
Common/Math/Armstrog Number/Armstrong.cpp:76
FunctionisArmstrong3
Common/Math/Armstrog Number/Armstrong.cpp:96
MethodisBalanced
Level 1/Week 04/Trees/110. Balanced Binary Tree/code.cpp:44
MethodisPalindrome
Helper function to check if a substring is palindrome
Level 0/10 Backtracking/06. 0131-palindrome-partitioning/code.cpp:6
MethodisPalindrome
Level 1/Week 04/Recursion/Check if a Number is a Palindrome/code.cpp:80
MethodisPalindrome
Helper function to check if a substring is a palindrome
Level 1/Week 10/Backtracking/131. Palindrome Partitioning/code.cpp:55
FunctionisPalindromeArray1
🔸 Approach 1: Two-Pointer Technique
Common/Math/Palindrome/palindrome.cpp:46
FunctionisPalindromeArray2
🔸 Approach 2: Reverse and Compare
Common/Math/Palindrome/palindrome.cpp:56
FunctionisPalindromeArray3
Common/Math/Palindrome/palindrome.cpp:68
FunctionisPalindromeArray4
🔸 Approach 4: Compare First Half with Second Half
Common/Math/Palindrome/palindrome.cpp:73
FunctionisPalindromeNumber1
🔸 Approach 1: Reverse Integer and Compare
Common/Math/Palindrome/palindrome.cpp:5
FunctionisPalindromeNumber2
🔸 Approach 2: String-Based Two Pointers
Common/Math/Palindrome/palindrome.cpp:16
FunctionisPalindromeNumber3
Common/Math/Palindrome/palindrome.cpp:35
FunctionisPrimeBruteForce
--------------------------------------------------- 🔸 Approach 1: Brute Force - Check all numbers from 2 to n-1 - If any divides n evenly, it is not p
Common/Math/Prime/prime_number.cpp:12
FunctionisPrimeOptimized
--------------------------------------------------- 🔸 Approach 2: Optimized Check (Up to √n) - If n has a factor larger than √n, then it must have o
Common/Math/Prime/prime_number.cpp:30
FunctionisPrimeRecursive
Helper function with divisor `i`
Common/Math/Prime/prime_number.cpp:49
MethodisSafe
Check if it's safe to place a queen at (row, col)
Level 1/Week 10/Backtracking/51. N-Queens/code.cpp:67
MethodisSameTree
Helper function to check if two trees are identical
Level 0/8 Trees/02. 0572-subtree-of-another-tree/code.cpp:16
MethodisSubtree
Level 0/8 Trees/02. 0572-subtree-of-another-tree/code.cpp:34
MethodisValid
Helper function to check if placing queen at (row, col) is valid
Level 0/10 Backtracking/08. 0051-n-queens/code.cpp:6
MethodisValid
Level 1/Week 06/Stack/20. Valid Parentheses/code.cpp:17
MethodisValidBST
Level 0/8 Trees/07. 0098-validate-binary-search-tree/code.cpp:33
MethodisValidBST
Level 1/Week 04/Trees/98. Validate Binary Search Tree/code.cpp:44
MethodisValidBSTHelper
Helper function to check if tree is valid BST within given range
Level 0/8 Trees/07. 0098-validate-binary-search-tree/code.cpp:16
MethodisValidSudoku
Level 1/Week 01/Arrays & Hashing/36. Valid Sudoku/code.cpp:30
Methodjump
Level 1/Week 09/Greedy/45. Jump Game II/code.cpp:24
MethodkthSmallest
Level 0/8 Trees/08. 0230-kth-smallest-element-in-a-bst/code.cpp:39
MethodkthSmallest
Level 1/Week 04/Trees/230. Kth Smallest Element in a BST/code.cpp:49
MethodladderLength
Level 1/Week 12/Graph/127. Word Ladder/code.cpp:24
MethodlargestRectangleArea
Level 1/Week 06/Stack/84. Largest Rectangle in Histogram/code.cpp:33
MethodlastStoneWeight
Level 1/Week 07/K way merge [Heaps]/1046. Last Stone Weight/code.cpp:22
MethodlengthOfLongestSubstring
Level 1/Week 02/Sliding windows/3. Longest Substring Without Repeating Characters/code.cpp:19
MethodletterCombinations
Level 0/10 Backtracking/07. 0017-letter-combinations-of-a-phone-number/code.cpp:35
MethodletterCombinations
Level 1/Week 10/Backtracking/17. Letter Combinations of a Phone Number/code.cpp:23
MethodlevelOrder
Level 0/8 Trees/04. 0102-binary-tree-level-order-traversal/code.cpp:15
MethodlevelOrder
Level 1/Week 04/Trees/102. Binary Tree Level Order Traversal/code.cpp:51
MethodlevelOrder1
Level 1/Week 04/Trees/102. Binary Tree Level Order Traversal/code.cpp:30
MethodlongestConsecutive
Level 1/Week 01/Arrays & Hashing/128. Longest Consecutive Sequence/code.cpp:26
MethodlowestCommonAncestor
Level 0/8 Trees/03. 0235-lowest-common-ancestor-of-a-bst/code.cpp:13
MethodlowestCommonAncestor
Level 1/Week 04/Trees/235. Lowest Common Ancestor of a Binary Search Tree/code.cpp:31
Functionmain
🔹 Driver Code
Common/Math/Print Divisors/print_all_divisors.cpp:76
Functionmain
🔹 Driver Code
Common/Math/Reverse Number/reverse_number.cpp:50
Functionmain
Common/Math/Extract Digits/extract_digit.cpp:34
Functionmain
🔹 Driver Code
Common/Math/GCD_HCF_Calculation/gcd.cpp:64
Functionmain
Common/Math/Count Digits/count.cpp:39
MethodmaxAreaOfIsland
Level 1/Week 12/Graph/695. Max Area of Island/code.cpp:21
MethodmaxDepth
Level 1/Week 04/Trees/104. Maximum Depth of Binary Tree/code.cpp:27
MethodmaxPathSum
Level 0/8 Trees/10. 0124-binary-tree-maximum-path-sum/code.cpp:39
MethodmaxPathSum
Level 1/Week 04/Trees/124. Binary Tree Maximum Path Sum/code.cpp:36
MethodmaxPathSum1
Level 1/Week 04/Trees/124. Binary Tree Maximum Path Sum/code.cpp:27
MethodmaxPathSumHelper
Returns the maximum path sum that can be extended from current node
Level 0/8 Trees/10. 0124-binary-tree-maximum-path-sum/code.cpp:18
MethodmaxSlidingWindow
Level 1/Week 06/Queue/239. Sliding Window Maximum/code.cpp:20
MethodmaxSlidingWindow
Level 1/Week 02/Sliding windows/239. Sliding Window Maximum/code.cpp:32
MethodmaxSubArray
Level 1/Week 09/Greedy/53. Maximum Subarray/code.cpp:25
← previousnext →101–200 of 315, ranked by callers