MCPcopy Create free account

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

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

↓ 1 callersMethodunionBySize
13. Graphs/5. MST Problems/07. Making Large Island.cpp:42
↓ 1 callersMethodunionSize
13. Graphs/5. MST Problems/05. Account Merge.cpp:38
↓ 1 callersMethodunionSize
13. Graphs/5. MST Problems/06. Number of islands 2.cpp:66
↓ 1 callersFunctionupperbound
02.Binary Search/1D Arrays/03.Implement_lower_upper_bound.cpp:44
FunctionAllPrimeFactors
QUESTION: Given a number N, find its unique prime factors in increasing order. Example: Input: N = 100 Output: 2 5 Explanation: 2 and 5 are the uniqu
06.Bit Manipulation/3. Advanced Maths/01. Prime factors of number.cpp:21
FunctionBSTIterator
12. Binary Search Trees/2. Practice Problems/09. BST Iterator.cpp:29
MethodDisjointSet
13. Graphs/5. MST Problems/05. Account Merge.cpp:25
MethodDisjointSet
13. Graphs/5. MST Problems/06. Number of islands 2.cpp:55
MethodDisjointSet
13. Graphs/5. MST Problems/04. Most stones removed.cpp:46
MethodDisjointSet
13. Graphs/5. MST Problems/02. Kruskal's Algorithm.cpp:39
MethodDisjointSet
13. Graphs/5. MST Problems/03. Number of Operations to make Network.cpp:28
MethodDisjointSet
13. Graphs/5. MST Problems/07. Making Large Island.cpp:29
FunctionJobScheduling
10. Greedy Approach/2. Medium/05. Job Sequencing Problem.cpp:37
MethodKthLargest
09. Heaps/3. Hard Problems/03. Kth largest element in stream.cpp:44
MethodLRUCache
07.Stack and Queues/4. Implementation/04. LRU Cache.cpp:45
FunctionLongestBitonicSequence
14. Dynamic Programming/7. DP on LIS/04. Longest Bitonic Subsequence.cpp:48
MethodMinStack
07.Stack and Queues/1. Learning/07. Implement min stack.cpp:43
MethodMyQueue
07.Stack and Queues/1. Learning/02. Implement queue using array.cpp:24
MethodMyStack
07.Stack and Queues/1. Learning/01. Implement stack using array.cpp:22
MethodMyStack
07.Stack and Queues/1. Learning/05. Implement stack using linked list.cpp:26
FunctionNthRoot
02.Binary Search/In Search Space/02.Nth_root_of_integer.cpp:29
MethodStackNode
07.Stack and Queues/1. Learning/05. Implement stack using linked list.cpp:20
MethodStockSpanner
07.Stack and Queues/4. Implementation/02. Stock span problem.cpp:29
MethodTrie
15. Tries/1. Theory/01. Implement Trie (Prefix Tree).cpp:36
MethodTrie
15. Tries/2. Problems/03. Count distinct subsitrings.cpp:30
MethodTrie
15. Tries/2. Problems/05. Maximum XOR of two numbers.cpp:41
MethodTrie
15. Tries/2. Problems/02. Complete String.cpp:45
MethodTrie
15. Tries/2. Problems/01. Implement Trie 2.cpp:38
MethodTrieNode
15. Tries/1. Theory/01. Implement Trie (Prefix Tree).cpp:24
MethodTrieNode
15. Tries/2. Problems/03. Count distinct subsitrings.cpp:20
MethodTrieNode
15. Tries/2. Problems/05. Maximum XOR of two numbers.cpp:30
MethodTrieNode
15. Tries/2. Problems/02. Complete String.cpp:33
MethodTrieNode
15. Tries/2. Problems/01. Implement Trie 2.cpp:25
FunctionTwitter
09. Heaps/3. Hard Problems/01. Design Twitter.cpp:35
FunctionaccountsMerge
13. Graphs/5. MST Problems/05. Account Merge.cpp:51
Methodadd
09. Heaps/3. Hard Problems/03. Kth largest element in stream.cpp:54
FunctionaddNode
04.Linked List/2.Doubly Linked List/02.Insert_node_in_DLL.cpp:42
FunctionaddNum
09. Heaps/3. Hard Problems/05. Median in a stream.cpp:35
FunctionaddOne
04.Linked List/3.Medium Problems of LL/12.Add_1_to_LL.cpp:32
FunctionaddTwoNumbers
04.Linked List/3.Medium Problems of LL/13.Add_two_LL.cpp:22
FunctionarrayRankTransform
09. Heaps/2. Medium Problems/05. Arrange by rank.cpp:24
FunctionarraySortedOrNot
02.Binary Search/1D Arrays/05.Check_If_array_is_sorted.cpp:34
FunctionasteroidCollision
07.Stack and Queues/3. Monotonic Stack and Queue/10. Asteroids Collision.cpp:26
Functionatoi
05.Recursion/1.Get Strong Hold/01.Implement_atoi_via_recursion.cpp:61
FunctionbeautySum
03.Strings/2.Medium/07.Sum_of_beauty_of_all_substrings.cpp:40
Functionbellman_ford
13. Graphs/4. Shortest Path Problems/08. Bellman Ford Algorithm.cpp:30
FunctionbfsOfGraph
13. Graphs/1. Learning/03. BFS.cpp:22
FunctionbitManipulation
QUESTION:- Given a 32-bit unsigned integer num and an integer i, perform the following operations on the number: 1. Get the ith bit. 2. Set the ith bi
06.Bit Manipulation/1. Learn Bit Manipulation/01.Bit Manipulation.cpp:24
MethodbottomUpHeapify
09. Heaps/1. Learning/01. Implement min heap.cpp:47
FunctionboundaryTraversal
11. Binary Trees/2. Medium Problems/07. Boundary Traversal.cpp:59
FunctionbstFromPreorder
12. Binary Search Trees/2. Practice Problems/08. Build BST from Preorder Traversal.cpp:40
FunctionbuildTree
11. Binary Trees/3. Hard/09. Construct BT from inorder and postorder.cpp:42
FunctionbuildTree
11. Binary Trees/3. Hard/08. Construct BT from inorder and preorder.cpp:42
FunctioncanFinish
13. Graphs/3. Topo Sort Problems/03. Course Scheduler 1.cpp:19
FunctioncanJump
10. Greedy Approach/2. Medium/02. Jump Game.cpp:27
FunctioncanPartition
14. Dynamic Programming/4. DP on Subsequences/02. Partition array in two equal sum subsets.cpp:92
Functioncandy
10. Greedy Approach/2. Medium/06. Candy.cpp:30
Functioncelebrity
07.Stack and Queues/4. Implementation/03. Celebrity Problem.cpp:30
Functionchange
14. Dynamic Programming/4. DP on Subsequences/09. Coin Change 2.cpp:93
FunctioncharacterReplacement
QUESTION: You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character
08. Sliding Window/1. Medium Problems/04. Longest Repeating Character.cpp:24
Functioncheck
CODE:-
01.Arrays/1.Easy/03.Check_if_array_is_sorted_and_rotated.cpp:33
FunctioncheckKthBit
QUESTION: Given a number N and a bit number K, check if the Kth index bit of N is set or not. A bit is called set if it is 1. The position of the set
06.Bit Manipulation/1. Learn Bit Manipulation/02.Check for the ith bit.cpp:14
FunctioncheckValidString
10. Greedy Approach/1. Easy/04. Valid Parenthesis String.cpp:39
FunctionclimbStairs
14. Dynamic Programming/2. 1D DP/01. Climbing Stairs.cpp:49
FunctioncoinChange
14. Dynamic Programming/4. DP on Subsequences/07. Coin Change.cpp:99
FunctioncombinationSum
05.Recursion/2.Subsequences Pattern/07.Combination Sum 1.cpp:48
FunctioncombinationSum2
05.Recursion/2.Subsequences Pattern/08.Combination Sum 2.cpp:52
FunctioncombinationSum3
05.Recursion/2.Subsequences Pattern/09.Combination Sum 3.cpp:51
Functioncomp
10. Greedy Approach/1. Easy/02. Fractional Knapsack.cpp:37
Functioncomp
10. Greedy Approach/2. Medium/08. Non Overlapping Intervals.cpp:28
Functioncomp
10. Greedy Approach/2. Medium/05. Job Sequencing Problem.cpp:33
FunctioncompleteString
15. Tries/2. Problems/02. Complete String.cpp:76
FunctionconnectRopes
09. Heaps/3. Hard Problems/02. Minimum Cost to join n ropes.cpp:31
FunctionconstructLL
04.Linked List/1. Single Linked List/01.Intro_to_linked_list.cpp:37
FunctionconvertMinToMaxHeap
09. Heaps/1. Learning/03. Convert min heap to max heap.cpp:42
FunctioncopyRandomList
QUESTION: A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or
04.Linked List/5.Hard Promblems of LL/03.Copy_LL_with_random_pointers.cpp:40
FunctioncountAndSay
16. Strings (Hard)/Hard/02. Count and Say.cpp:30
FunctioncountDistinctIslands
13. Graphs/2. Traversal Problems/10. Distinct Islands.cpp:27
FunctioncountDistinctSubstring
15. Tries/2. Problems/03. Count distinct subsitrings.cpp:47
FunctioncountGoodNumbers
05.Recursion/1.Get Strong Hold/02.Count_good_numbers.cpp:36
FunctioncountNodes
11. Binary Trees/3. Hard/07. Count nodes in complete binary tree.cpp:45
FunctioncountNodesinLoop
04.Linked List/3.Medium Problems of LL/05.Count_nodes_in_loop.cpp:51
FunctioncountOccurrences
02.Binary Search/1D Arrays/07.Number_of_occurences.cpp:30
FunctioncountPartitions
14. Dynamic Programming/4. DP on Subsequences/05. Partition with given difference.cpp:103
FunctioncountPaths
13. Graphs/4. Shortest Path Problems/11. Number of ways to arrive the destination with minimum distance.cpp:26
FunctioncountPrimes
QUESTION: Given an integer n, return the number of prime numbers that are strictly less than n. Example: Input: n = 10 Output: 4 Explanation: There a
06.Bit Manipulation/3. Advanced Maths/03. Sieve of Eratosthenes.cpp:20
FunctioncountSetBits
QUESTION: You are given a number N. Find the total count of set bits for all numbers from 1 to N (both inclusive). Example: Input: N = 4 Output: 5 Ex
06.Bit Manipulation/1. Learn Bit Manipulation/08.Count set bit from numbers 1 to n.cpp:21
FunctioncountSquares
14. Dynamic Programming/9. DP on Squares/02. Count square submatrices.cpp:52
MethodcountWordsEqualTo
15. Tries/2. Problems/01. Implement Trie 2.cpp:54
MethodcountWordsStartingWith
15. Tries/2. Problems/01. Implement Trie 2.cpp:65
FunctioncountingGraphs
13. Graphs/1. Learning/01. Count the number of graphs.cpp:15
Functioncreate_tree
11. Binary Trees/1. Traversals/02. Binary Tree representation.cpp:45
FunctioncriticalConnections
13. Graphs/6. Other Algorithms/01. Bridges in graph.cpp:42
FunctioncutRod
14. Dynamic Programming/4. DP on Subsequences/11. Rod Cutting Problem.cpp:65
FunctiondeleteAllOccurOfX
04.Linked List/4.Medium Problems of DLL/01.Delete_nodes_from_dll.cpp:25
FunctiondeleteMiddle
04.Linked List/3.Medium Problems of LL/09.Delete_mid_of_LL.cpp:26
FunctiondeleteNode
04.Linked List/1. Single Linked List/03.Deleting_node_in_linked_list.cpp:39
FunctiondeleteNode
Given a doubly linked list and a position. The task is to delete a node from given position in a doubly linked list. Example 1: Input: LinkedList =
04.Linked List/2.Doubly Linked List/03.Delete_node_in_DLL.cpp:31
FunctiondeleteNode
12. Binary Search Trees/2. Practice Problems/04. Delete from BST.cpp:33
Methoddequeue
07.Stack and Queues/1. Learning/04. Implement queue using stacks.cpp:30
← previousnext →201–300 of 668, ranked by callers