MCPcopy Create free account

hub / github.com/Codensity30/Strivers-A2Z-DSA-Sheet / functions

Functions668 in github.com/Codensity30/Strivers-A2Z-DSA-Sheet

↓ 1 callersMethodinsert
15. Tries/2. Problems/03. Count distinct subsitrings.cpp:34
↓ 1 callersMethodinsert
15. Tries/2. Problems/05. Maximum XOR of two numbers.cpp:45
↓ 1 callersFunctioninsertAtBottom
QUESTION: Reverse a given stack of 'N' integers using recursion. Note: You are not allowed to use any extra space other than the internal stack space
05.Recursion/1.Get Strong Hold/03.Reverse_stack_using_recursion.cpp:26
↓ 1 callersFunctionisAdj
13. Graphs/2. Traversal Problems/08. Word Ladder.cpp:22
↓ 1 callersFunctionisAlphaNumeric
07.Stack and Queues/2. Infix, Postfix, and Prefix/05. Postfix to infix.cpp:23
↓ 1 callersFunctionisAlphaNumeric
07.Stack and Queues/2. Infix, Postfix, and Prefix/04. Prefix to postfix.cpp:23
↓ 1 callersFunctionisAlphaNumeric
07.Stack and Queues/2. Infix, Postfix, and Prefix/06. Postfix to prefix.cpp:23
↓ 1 callersFunctionisLand
13. Graphs/5. MST Problems/06. Number of islands 2.cpp:79
↓ 1 callersFunctionisMirror
11. Binary Trees/2. Medium Problems/12. Symmetric Tree.cpp:33
↓ 1 callersFunctionisPalindrome
QUESTION: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s.
05.Recursion/3.Try Out All Combos/01.Palindrome partioning.cpp:29
↓ 1 callersFunctionisPalindrome
14. Dynamic Programming/8. DP on Partition/05. Palindorme Partionting 2.cpp:27
↓ 1 callersFunctionisPossible
QUESTION: Given an undirected graph and an integer M. The task is to determine if the graph can be colored with at most M colors such that no two adja
05.Recursion/3.Try Out All Combos/04.M coloring problem.cpp:26
↓ 1 callersFunctionisPossible
02.Binary Search/In Search Space/12.Gas_station.cpp:37
↓ 1 callersFunctionisPossible
02.Binary Search/In Search Space/03.Koko_eating_banana.cpp:30
↓ 1 callersFunctionisPossible
02.Binary Search/In Search Space/10.Split_array_largest.cpp:25
↓ 1 callersFunctionisPossible
02.Binary Search/In Search Space/06.Capacity_to_ship_packages.cpp:26
↓ 1 callersFunctionisPossible
02.Binary Search/In Search Space/08.Aggresive_cows.cpp:28
↓ 1 callersFunctionisPossible
02.Binary Search/In Search Space/04.Minimum_days_to_make_boquets.cpp:37
↓ 1 callersFunctionisPossible
02.Binary Search/In Search Space/09.Book_allocation.cpp:34
↓ 1 callersFunctionisPowerOfTwo
QUESTION: Given a non-negative number N, set the rightmost unset bit in its binary representation. If there are no unset bits, leave the number as it
06.Bit Manipulation/1. Learn Bit Manipulation/05.Set the righmost unset bit.cpp:29
↓ 1 callersFunctionisValid
QUESTION: Consider a rat placed at (0, 0) in a square matrix of order N * N. It has to reach the destination at (N - 1, N - 1). Find all possible path
05.Recursion/3.Try Out All Combos/03.Rat in maze.cpp:39
↓ 1 callersFunctionisValid
05.Recursion/3.Try Out All Combos/05.N queens.cpp:64
↓ 1 callersFunctionisValid
05.Recursion/3.Try Out All Combos/07.Sudoku solver.cpp:51
↓ 1 callersFunctionisValid
13. Graphs/4. Shortest Path Problems/04. Shortest Path in binary matrix.cpp:28
↓ 1 callersMethodisvalid
15. Tries/2. Problems/02. Complete String.cpp:62
↓ 1 callersFunctionkmp
16. Strings (Hard)/Hard/04. Longest Happy Prefix.cpp:25
↓ 1 callersFunctionkmp
16. Strings (Hard)/Hard/05. Shortest Palindrome.cpp:26
↓ 1 callersFunctionlargestRectangleArea
Function to calculate the largest rectangle area in a histogram represented by heights
07.Stack and Queues/3. Monotonic Stack and Queue/09. Maximal Rectangle in binary matrix.cpp:52
↓ 1 callersFunctionleftHeight
11. Binary Trees/3. Hard/07. Count nodes in complete binary tree.cpp:27
↓ 1 callersFunctionleftTraversal
11. Binary Trees/2. Medium Problems/07. Boundary Traversal.cpp:24
↓ 1 callersFunctionlowerbound
02.Binary Search/1D Arrays/03.Implement_lower_upper_bound.cpp:27
↓ 1 callersFunctionlps
16. Strings (Hard)/Hard/03. KMP or Z string matching algo.cpp:25
↓ 1 callersFunctionmaxDepth
11. Binary Trees/2. Medium Problems/03. Diameter of Binary Tree.cpp:22
↓ 1 callersFunctionmax_finder
02.Binary Search/2D Arrays/4.Peak_element_in_matrix.cpp:32
↓ 1 callersFunctionmerge
01.Arrays/3.Hard/10.Count_inversions.cpp:26
↓ 1 callersFunctionmerge
01.Arrays/3.Hard/11.Reverse_pairs.cpp:29
↓ 1 callersFunctionmerge
04.Linked List/5.Hard Promblems of LL/04.Flatten_LL.cpp:21
↓ 1 callersFunctionmerge
04.Linked List/3.Medium Problems of LL/10.Sort_LL.cpp:22
↓ 1 callersFunctionmergeSort
04.Linked List/3.Medium Problems of LL/10.Sort_LL.cpp:37
↓ 1 callersFunctionmergesort
01.Arrays/3.Hard/10.Count_inversions.cpp:55
↓ 1 callersFunctionmergesort
01.Arrays/3.Hard/11.Reverse_pairs.cpp:68
↓ 1 callersFunctionminimumSumOfSizeK
08. Sliding Window/1. Medium Problems/08. Maximum Points you can obtaln form the card.cpp:27
↓ 1 callersFunctionnewNode
11. Binary Trees/1. Traversals/02. Binary Tree representation.cpp:24
↓ 1 callersFunctionnextGreater
07.Stack and Queues/3. Monotonic Stack and Queue/06. Sum of range of all subarray.cpp:64
↓ 1 callersFunctionnextGstack
07.Stack and Queues/3. Monotonic Stack and Queue/01. Next Greater Element.cpp:25
↓ 1 callersFunctionnextSmaller
07.Stack and Queues/3. Monotonic Stack and Queue/08. Largest Rectangle in Histogram.cpp:41
↓ 1 callersFunctionnextSmaller
07.Stack and Queues/3. Monotonic Stack and Queue/06. Sum of range of all subarray.cpp:38
↓ 1 callersFunctionnextSmaller
Helper function to calculate the next smaller element index for each element in an array
07.Stack and Queues/3. Monotonic Stack and Queue/09. Maximal Rectangle in binary matrix.cpp:38
↓ 1 callersFunctionnextSmaller
07.Stack and Queues/3. Monotonic Stack and Queue/05. Sum of subarray minimum.cpp:31
↓ 1 callersFunctionnext_nonzero
CODE:- function to find the next non-zero element
01.Arrays/1.Easy/07.Move_0's_to_end.cpp:24
↓ 1 callersFunctionplaceAtCorrectPos
QUESTION: Given a stack, the task is to sort it such that the top of the stack has the greatest element. Example 1: Input: Stack: 3 2 1 Output: 3 2 1
05.Recursion/1.Get Strong Hold/04.Sort_stack_using_recursion.cpp:31
↓ 1 callersFunctionprevGreater
07.Stack and Queues/3. Monotonic Stack and Queue/06. Sum of range of all subarray.cpp:51
↓ 1 callersFunctionprevSmaller
07.Stack and Queues/3. Monotonic Stack and Queue/08. Largest Rectangle in Histogram.cpp:28
↓ 1 callersFunctionprevSmaller
NOTE:- The code could be more concise if done in double traversal but I find this more intuitive
07.Stack and Queues/3. Monotonic Stack and Queue/06. Sum of range of all subarray.cpp:25
↓ 1 callersFunctionprevSmaller
Helper function to calculate the previous smaller element index for each element in an array
07.Stack and Queues/3. Monotonic Stack and Queue/09. Maximal Rectangle in binary matrix.cpp:24
↓ 1 callersFunctionprevSmaller
QUESTION: Given an array of integers arr, find the sum of min(b), where b ranges over every (contiguous) subarray of arr. Since the answer may be larg
07.Stack and Queues/3. Monotonic Stack and Queue/05. Sum of subarray minimum.cpp:18
↓ 1 callersMethodpush
07.Stack and Queues/1. Learning/03. Implement stack using queue.cpp:24
↓ 1 callersFunctionreverseLL
04.Linked List/3.Medium Problems of LL/06.Check_for_palindrome_LL.cpp:24
↓ 1 callersFunctionrightHeight
11. Binary Trees/3. Hard/07. Count nodes in complete binary tree.cpp:36
↓ 1 callersFunctionrightTraversal
11. Binary Trees/2. Medium Problems/07. Boundary Traversal.cpp:45
↓ 1 callersFunctionsetAdj
13. Graphs/3. Topo Sort Problems/06. Alien Dictonary.cpp:21
↓ 1 callersFunctionsetParent
11. Binary Trees/3. Hard/06. Min time to burn binary tree.cpp:48
↓ 1 callersFunctionsolve
QUESTION: Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the cand
05.Recursion/2.Subsequences Pattern/08.Combination Sum 2.cpp:31
↓ 1 callersFunctionsolve
05.Recursion/2.Subsequences Pattern/01.Genereate all valid parenthesis.cpp:29
↓ 1 callersFunctionsolve
QUESTION: Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the ans
05.Recursion/2.Subsequences Pattern/10.Letter combinations of phone.cpp:30
↓ 1 callersFunctionsolve
QUESTION: Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the
05.Recursion/2.Subsequences Pattern/07.Combination Sum 1.cpp:30
↓ 1 callersFunctionsolve
QUESTION: Given an integer array nums of unique elements, return all possible subsets (the power set). Example 1: Input: nums = [1,2,3] Output: [[],[
05.Recursion/2.Subsequences Pattern/02.Power set.cpp:32
↓ 1 callersFunctionsolve
QUESTION: Given a list arr of N integers, print the sums of all subsets in it. Example: Input: N = 2 arr[] = {2, 3} Output: 0 2 3 5 Explanation: When
05.Recursion/2.Subsequences Pattern/05.Subset 1.cpp:34
↓ 1 callersFunctionsolve
05.Recursion/2.Subsequences Pattern/03.Count distinct substrings.cpp:31
↓ 1 callersFunctionsolve
05.Recursion/2.Subsequences Pattern/06.Subset 2.cpp:33
↓ 1 callersFunctionsolve
QUESTION: Find all valid combinations of k numbers that sum up to n such that the following conditions are true: - Only numbers 1 through 9 are used.
05.Recursion/2.Subsequences Pattern/09.Combination Sum 3.cpp:33
↓ 1 callersFunctionsolve
QUESTION: Given an array arr[] of non-negative integers and an integer sum, the task is to count all subsets of the given array with a sum equal to th
05.Recursion/2.Subsequences Pattern/04.Count subsets with sum equal to k.cpp:27
↓ 1 callersFunctionsolve
05.Recursion/3.Try Out All Combos/03.Rat in maze.cpp:45
↓ 1 callersFunctionsolve
05.Recursion/3.Try Out All Combos/04.M coloring problem.cpp:34
↓ 1 callersFunctionsolve
05.Recursion/3.Try Out All Combos/06.Word Break.cpp:20
↓ 1 callersFunctionsolve
05.Recursion/3.Try Out All Combos/05.N queens.cpp:37
↓ 1 callersFunctionsolve
05.Recursion/3.Try Out All Combos/01.Palindrome partioning.cpp:40
↓ 1 callersFunctionsolve
05.Recursion/3.Try Out All Combos/02.Word search in grid.cpp:46
↓ 1 callersFunctionsolve
02.Binary Search/1D Arrays/05.Check_If_array_is_sorted.cpp:23
↓ 1 callersFunctionsolve
09. Heaps/1. Learning/02. Check if array is heap.cpp:23
↓ 1 callersFunctionsolve
12. Binary Search Trees/2. Practice Problems/06. Validate BST.cpp:30
↓ 1 callersFunctionsolve
12. Binary Search Trees/2. Practice Problems/08. Build BST from Preorder Traversal.cpp:30
↓ 1 callersFunctionsolve
12. Binary Search Trees/2. Practice Problems/01. Ceil in BST.cpp:39
↓ 1 callersFunctionsolve
12. Binary Search Trees/2. Practice Problems/12. Largest BST in Binary Tree.cpp:21
↓ 1 callersFunctionsolve
11. Binary Trees/2. Medium Problems/04. Maximum Path Sum.cpp:26
↓ 1 callersFunctionsolve
11. Binary Trees/2. Medium Problems/02. Balanced Binary Tree.cpp:18
↓ 1 callersFunctionsolve
11. Binary Trees/3. Hard/04. Check children sum property.cpp:37
↓ 1 callersFunctionsolve
11. Binary Trees/3. Hard/09. Construct BT from inorder and postorder.cpp:26
↓ 1 callersFunctionsolve
11. Binary Trees/3. Hard/08. Construct BT from inorder and preorder.cpp:26
↓ 1 callersFunctionsolve
11. Binary Trees/1. Traversals/02. Binary Tree representation.cpp:32
↓ 1 callersFunctionsolve
11. Binary Trees/1. Traversals/03. Preorder Traversal.cpp:23
↓ 1 callersFunctionsolve
11. Binary Trees/1. Traversals/04. Inorder Traversal.cpp:22
↓ 1 callersFunctionsolve
11. Binary Trees/1. Traversals/05. Postorder Traversal.cpp:22
↓ 1 callersFunctionstartOfCycle
04.Linked List/3.Medium Problems of LL/04.Start_of_cycle_in_LL.cpp:34
↓ 1 callersFunctiontopo
13. Graphs/6. Other Algorithms/02. Strongly Connected Components.cpp:19
↓ 1 callersFunctiontraversal
12. Binary Search Trees/2. Practice Problems/11. Recover BST.cpp:22
↓ 1 callersFunctiontraversal
11. Binary Trees/1. Traversals/10. All in one traversal.cpp:20
↓ 1 callersMethodunionBySize
13. Graphs/5. MST Problems/04. Most stones removed.cpp:59
↓ 1 callersMethodunionBySize
13. Graphs/5. MST Problems/02. Kruskal's Algorithm.cpp:52
↓ 1 callersMethodunionBySize
13. Graphs/5. MST Problems/03. Number of Operations to make Network.cpp:41
← previousnext →101–200 of 668, ranked by callers