MCPcopy Create free account

hub / github.com/devparthgarg/Data-Structures-and-Algorithms / functions

Functions1,161 in github.com/devparthgarg/Data-Structures-and-Algorithms

↓ 2 callersFunctionprint
11. Linked List/16 Delete At Tail Double LL/16 Delete At Tail Doubly LL.cpp:47
↓ 2 callersFunctionprint
11. Linked List/38 Clone a LL with Random Pointer/38a Clone a LL with Random Pointer.cpp:45
↓ 2 callersFunctionprint
11. Linked List/29 Remove Duplicates from Sorted LL/29 Remove Duplicates from Sorted LL.cpp:45
↓ 2 callersFunctionprint
11. Linked List/13 Insert At Tail Doubly LL/13 Insert At Tail Doubly LL.cpp:43
↓ 2 callersFunctionprint
11. Linked List/08 Insert At Given Position/08 Insert At Given Position.cpp:55
↓ 2 callersFunctionprint
11. Linked List/19 Insert At Head Circular LL/19a Insert At Head Circular LL.cpp:43
↓ 2 callersFunctionprint
11. Linked List/19 Insert At Head Circular LL/19b Insert At Head Circular LL.cpp:41
↓ 2 callersFunctionprint
11. Linked List/21 Delete at Head Circular LL/21 Delete At Head Circular LL.cpp:45
↓ 2 callersFunctionprint
11. Linked List/22 Delete Kth Node in Circular LL/22 Delete Kth Node in Circular LL.cpp:73
↓ 2 callersFunctionprint
11. Linked List/36 Intersection Point of Two Linked Lists/36a Intersection Point of Two Linked Lists.cpp:44
↓ 2 callersFunctionprint
11. Linked List/36 Intersection Point of Two Linked Lists/36b Intersection Point of Two Linked Lists.cpp:53
↓ 2 callersFunctionprint
11. Linked List/06 Delete At Head/06 Delete At Head.cpp:33
↓ 2 callersFunctionprint
11. Linked List/34 Delete Node With Only Pointer Given/34 Delete Node With Only Pointer Given.cpp:33
↓ 2 callersFunctionprint
11. Linked List/30 Reverse LL in group size of K/30a Reverse LL in group size of K.cpp:50
↓ 2 callersFunctionprint
11. Linked List/30 Reverse LL in group size of K/30b Reverse LL in group size of K.cpp:50
↓ 2 callersFunctionprint
11. Linked List/35 Seagregate Even Odd Nodes of LL/35 Segregate Even Odd Nodes of LL.cpp:72
↓ 2 callersFunctionprint
11. Linked List/14 Reverse Doubly LL/14 Reverse Doubly LL.cpp:42
↓ 2 callersFunctionprint
11. Linked List/03 Recursive Traversal/04 Insert at Head.cpp:27
↓ 2 callersFunctionprint
11. Linked List/15 Delete At Head Doubly LL/15 Delete At Head Doubly LL.cpp:42
↓ 2 callersFunctionprint
11. Linked List/24 Sorted Insert in LL/24 Sorted Insert in LL.cpp:47
↓ 2 callersFunctionprint
11. Linked List/37 Pairwise Node Swap of LL/37 Pairwise Node Swap of LL.cpp:31
↓ 2 callersFunctionprint
11. Linked List/27 Iterative Reverse of LL/27a Iterative Reverse of LL.cpp:43
↓ 2 callersFunctionprint
11. Linked List/27 Iterative Reverse of LL/27b Iterative Reverse of LL.cpp:35
↓ 2 callersFunctionprint
13. Queue/04_Reversing_Queue_Iterative.cpp:4
↓ 2 callersFunctionprint
13. Queue/05_Reversing_Queue_Recursive.cpp:4
↓ 2 callersFunctionprintPrimes
time: O(n*log(log(n))) space: O(1) Sieve Method
02. Mathematics/10 Sieve of Eratosthenes/10b.cpp:12
↓ 2 callersFunctionprintPrimes
time: O(n*sqrt(n)) space: O(1)
02. Mathematics/10 Sieve of Eratosthenes/10a.cpp:39
↓ 2 callersFunctionprintPrimes
time: O(n*log(log(n))) space: O(1) Sieve Method Much More Optimised and Code Length Reduced
02. Mathematics/10 Sieve of Eratosthenes/10d.cpp:12
↓ 2 callersFunctionprintPrimes
time: O(n*log(log(n))) space: O(1) Sieve Method More Optimised
02. Mathematics/10 Sieve of Eratosthenes/10c.cpp:12
↓ 2 callersMethodpush2
12. Stacks/05 Two Stacks in an Array/05 Two Stacks in an Array.cpp:33
↓ 2 callersFunctionreverse
13. Queue/04_Reversing_Queue_Iterative.cpp:14
↓ 2 callersMethodsize
12. Stacks/02 Implementation/02c Implementation using Linked List.cpp:62
↓ 2 callersMethodtop
12. Stacks/02 Implementation/02c Implementation using Linked List.cpp:51
↓ 2 callersMethodtop
12. Stacks/02 Implementation/02b Implementation using Vectors.cpp:24
↓ 2 callersFunctiontrailingZeroes
time: O(log5(n)) space: O(1) optimised
02. Mathematics/04 Trailing Zeroes in Factorial/04b.cpp:12
↓ 1 callersFunctionBTtoDLL
15. Binary Tree/17 Convert Binary Tree to Doubly Linked List/17.cpp:40
↓ 1 callersFunctionLCA
Time: O(N) space: O(H)
15. Binary Tree/21 LCA of Binary Tree/21b.cpp:21
↓ 1 callersFunctionLCA
Time: O(N) space: O(N)
15. Binary Tree/21 LCA of Binary Tree/21a.cpp:45
↓ 1 callersFunctionNthNode
Time: O(N) Space: O(1)
11. Linked List/26 Find Nth Node From End Of LL/26a Find Nth Node From End Of LL.cpp:19
↓ 1 callersFunctionNthNode
Time: O(N) Space: O(1)
11. Linked List/26 Find Nth Node From End Of LL/26b Find Nth Node From End Of LL.cpp:19
↓ 1 callersFunctionactivitySelection
time: O(n*logn) space: O(1)
19. Greedy Algorithms/02 Activity Selection/02 Activity Selection.cpp:6
↓ 1 callersFunctionallocatePages
06. Searching/17 Allocate Minimum Pages/17.cpp:34
↓ 1 callersFunctionbalancedTree
Time: O(N) Space: O(H)
15. Binary Tree/15 Check for Balanced Binary Tree/15b.cpp:29
↓ 1 callersFunctionbalancedTree
Time: O(N*N) Space: O(LogN)
15. Binary Tree/15 Check for Balanced Binary Tree/15a.cpp:39
↓ 1 callersFunctionbfs
find number of islands problem or find number of connected components
18. Graphs/04 Breadth First Search/04c Breadth First Search.cpp:5
↓ 1 callersFunctionbfs
given undirected graph with source vertex print BFS
18. Graphs/04 Breadth First Search/04a Breadth First Search.cpp:5
↓ 1 callersFunctionbfs
no source given and graph mey be disconnected
18. Graphs/04 Breadth First Search/04b Breadth First Search.cpp:5
↓ 1 callersFunctionbfsCon
18. Graphs/04 Breadth First Search/04c Breadth First Search.cpp:27
↓ 1 callersFunctionbfsDis
18. Graphs/04 Breadth First Search/04b Breadth First Search.cpp:29
↓ 1 callersFunctionbinarySearch
time: O(logn)
06. Searching/01 Binary Search/01a.cpp:5
↓ 1 callersFunctionbinarySearch
time: O(logn) space: O(logn)
06. Searching/01 Binary Search/01b.cpp:6
↓ 1 callersFunctionbinarySearch
06. Searching/07 Search in Infinite Sized Array/07b search in infinite sorted array.cpp:4
↓ 1 callersFunctionbonacciseries
time: O(m)
05. Arrays/25 N-Bonnaci Number/25 N-Bonnaci Number.cpp:5
↓ 1 callersFunctionboundaryTraversal
08. Matrix/03 Boundary Traversal/03 Boundary Traversal.cpp:5
↓ 1 callersFunctionbubbleSort
time: O(n*n) space: O(1)
07. Sorting/03 Bubble Sort/03a Bubble Sort.cpp:12
↓ 1 callersFunctionbubbleSort
time: O(n*n) space: O(1)
07. Sorting/03 Bubble Sort/03b Bubble Sort Optimized.cpp:6
↓ 1 callersFunctionbuildheap
17. Heaps/09 Heap Sort/09 Heap Sort.cpp:22
↓ 1 callersFunctionburnTree
15. Binary Tree/22 Burn Binary Tree from Leaf/22.cpp:21
↓ 1 callersFunctionceil
Iterative Implementation Time: O(logN) Space: O(1)
16. Binary Search Tree/05 Ceil in BST/05 Ceil in BST.cpp:29
↓ 1 callersFunctioncheck
20. Backtracking/01 Print Permutations of Strings with Given Condition/01b Print Permutations of Strings with Given Condition.cpp:9
↓ 1 callersFunctioncheckSubarray0Sum
time: O(n) space: O(n)
05. Arrays/30 Check if Subarray with Zero Sum/30 Check if Subarray with Zero sum.cpp:6
↓ 1 callersFunctionchildrenSum
Time: O(N) Space: O(H)
15. Binary Tree/14 Children Sum Property/14.cpp:34
↓ 1 callersFunctioncircularTour
time: O(N*N) space: O(1)
14. Deque/06 First Circular Tour/06a.cpp:17
↓ 1 callersFunctioncircularTour
time: O(N) space: O(1)
14. Deque/06 First Circular Tour/06b.cpp:17
↓ 1 callersFunctionclone
Time: O(N) Space: O(N)
11. Linked List/38 Clone a LL with Random Pointer/38a Clone a LL with Random Pointer.cpp:21
↓ 1 callersFunctioncoinChange
Memoization
21. Dynamic Programming/04 Coin Change/04b Coin Change.cpp:7
↓ 1 callersFunctioncoinChange
Tabulation
21. Dynamic Programming/04 Coin Change/04c Coin Change.cpp:5
↓ 1 callersFunctioncoinChange
Recursion
21. Dynamic Programming/04 Coin Change/04a Coin Change.cpp:5
↓ 1 callersFunctioncount
Time: O(N) Space: O(H)
15. Binary Tree/23 Count Nodes in Complete Binary Tree/23a.cpp:28
↓ 1 callersFunctioncount
Time: O(LogN*logN) Space: O(H)
15. Binary Tree/23 Count Nodes in Complete Binary Tree/23b.cpp:28
↓ 1 callersFunctioncount1s
time: O(n)
06. Searching/05 Count 1s in Sorted Binary Array/05a.cpp:5
↓ 1 callersFunctioncount1s
06. Searching/05 Count 1s in Sorted Binary Array/05b.cpp:11
↓ 1 callersFunctioncountAndMerge
07. Sorting/10 Count Inversions in Array/10b count inversions in array.cpp:4
↓ 1 callersFunctioncountDigits
time: O(log10(n)) space: O(1)
02. Mathematics/01 Count Digits/01.cpp:10
↓ 1 callersFunctioncountDistinct
09. Hashing/03 Count Distinct/03b Count Distinct.cpp:4
↓ 1 callersFunctioncountDistinct
09. Hashing/03 Count Distinct/03a Count Distinct.cpp:4
↓ 1 callersFunctioncountInversions
07. Sorting/10 Count Inversions in Array/10b count inversions in array.cpp:57
↓ 1 callersFunctioncountInversions
07. Sorting/10 Count Inversions in Array/10a count inversions in array.cpp:6
↓ 1 callersFunctioncountOccurrence
time: O(logn)
06. Searching/04 Count Occurrences/04b.cpp:73
↓ 1 callersFunctioncountOccurrence
time: O(n)
06. Searching/04 Count Occurrences/04a.cpp:5
↓ 1 callersFunctioncountSubset
04. Recursion/15 Subset Sum Problem/15 Subset Sum Problem.cpp:4
↓ 1 callersFunctiondel
Time: O(n) delete at begin Time: O(1) delete at end
05. Arrays/03 Delete/03 Delete.cpp:6
↓ 1 callersFunctiondel
16. Binary Search Tree/03 Delete in BST/03 Delete in BST.cpp:35
↓ 1 callersMethoddelMax
14. Deque/04 Data Structure with Min Max Operation/04.cpp:44
↓ 1 callersMethoddelMin
14. Deque/04 Data Structure with Min Max Operation/04.cpp:39
↓ 1 callersFunctiondeleteAtHead
Time: O(N) Space: O(1)
11. Linked List/21 Delete at Head Circular LL/21 Delete At Head Circular LL.cpp:19
↓ 1 callersFunctiondeleteAtHead
11. Linked List/22 Delete Kth Node in Circular LL/22 Delete Kth Node in Circular LL.cpp:17
↓ 1 callersFunctiondeleteAtHead
Time: O(1) Space: O(1)
11. Linked List/06 Delete At Head/06 Delete At Head.cpp:19
↓ 1 callersFunctiondeleteAtHead
Time: O(1) Space: O(1)
11. Linked List/15 Delete At Head Doubly LL/15 Delete At Head Doubly LL.cpp:21
↓ 1 callersFunctiondeleteAtTail
Time: O(N) Space: O(1)
11. Linked List/07 Delete At Tail/07 Delete At Tail.cpp:19
↓ 1 callersFunctiondeleteAtTail
Time: O(N) Space: O(1)
11. Linked List/16 Delete At Tail Double LL/16 Delete At Tail Doubly LL.cpp:21
↓ 1 callersFunctiondeleteKthNode
Time: O(N) Space: O(1)
11. Linked List/22 Delete Kth Node in Circular LL/22 Delete Kth Node in Circular LL.cpp:45
↓ 1 callersFunctiondeleteNode
Time: O(1) Space: O(1)
11. Linked List/34 Delete Node With Only Pointer Given/34 Delete Node With Only Pointer Given.cpp:19
↓ 1 callersFunctiondeserialize
Time: O(N) space: O(N)
15. Binary Tree/24 Serialize and Deserialize Binary Tree/24.cpp:41
↓ 1 callersFunctiondetectLoop
Time: O(N) Space: O(N)
11. Linked List/31 Detect Loop/31a Detect Loop.cpp:19
↓ 1 callersFunctiondetectLoop
Time: O(N) Space: O(1)
11. Linked List/31 Detect Loop/31b Detect Loop.cpp:24
↓ 1 callersFunctiondetectLoop
Time: O(N) Space: O(1)
11. Linked List/32 Detect Loop Using Floyd Cycle Detection/32 Detect Loop Using Floyd Cycle Detection.cpp:19
↓ 1 callersFunctiondfs
sorce given and graph may be disconnected
18. Graphs/05 Depth First Search/05b Depth First Search.cpp:19
↓ 1 callersFunctiondfs
count number of connected components
18. Graphs/05 Depth First Search/05c Depth First Search.cpp:18
↓ 1 callersFunctiondfs
given undirected graph with source vertex print DFS
18. Graphs/05 Depth First Search/05a Depth First Search.cpp:19
← previousnext →101–200 of 1,161, ranked by callers