MCPcopy Create free account

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

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

↓ 1 callersFunctiondfsRec
18. Graphs/05 Depth First Search/05b Depth First Search.cpp:4
↓ 1 callersFunctiondfsRec
18. Graphs/05 Depth First Search/05c Depth First Search.cpp:4
↓ 1 callersFunctiondfsRec
18. Graphs/05 Depth First Search/05a Depth First Search.cpp:4
↓ 1 callersFunctiondiameter
15. Binary Tree/20 Diameter of Binary Tree/20.cpp:22
↓ 1 callersFunctiondisplay
17. Heaps/11 Sort K Sorted Array/11b Sort K-Sorted Array.cpp:39
↓ 1 callersFunctiondisplay
17. Heaps/11 Sort K Sorted Array/11a Sort K-Sorted Array.cpp:15
↓ 1 callersFunctiondisplay
08. Matrix/06 Spiral Traversal/06 Spiral Traversal.cpp:51
↓ 1 callersFunctiondistinctInKSizeWindow
09. Hashing/14 Count Distinct Elements in a Window of size K/14b Count Distinct Elements in Window of size K.cpp:4
↓ 1 callersFunctiondistinctInKSizeWindow
09. Hashing/14 Count Distinct Elements in a Window of size K/14a Count Distinct Elements in Window of size K.cpp:4
↓ 1 callersFunctiondistinctInKSizeWindow
09. Hashing/14 Count Distinct Elements in a Window of size K/14c Count Distinct Elements in Window of size K.cpp:4
↓ 1 callersFunctioneditDistance
Recursion
21. Dynamic Programming/05 Edit Distance/05a Edit Distance.cpp:10
↓ 1 callersFunctioneditDistance
Tabulation
21. Dynamic Programming/05 Edit Distance/05c Edit Distance.cpp:10
↓ 1 callersFunctioneditDistance
Memoization
21. Dynamic Programming/05 Edit Distance/05b Edit Distance.cpp:12
↓ 1 callersMethodempty
12. Stacks/02 Implementation/02c Implementation using Linked List.cpp:67
↓ 1 callersMethodempty
12. Stacks/02 Implementation/02b Implementation using Vectors.cpp:34
↓ 1 callersFunctionfactorial
time: O(n) space: O(n)
02. Mathematics/03 Factorial of a Number/03b.cpp:10
↓ 1 callersFunctionfactorial
time: O(n) space: O(1)
02. Mathematics/03 Factorial of a Number/03a.cpp:10
↓ 1 callersFunctionfactorial
02. Mathematics/04 Trailing Zeroes in Factorial/04a.cpp:9
↓ 1 callersFunctionfactorial
04. Recursion/06 Factorial/06 Factorial of Number.cpp:7
↓ 1 callersFunctionfib
Recursion
21. Dynamic Programming/02 Nth Fibonacci/02a Nth Fibonacci.cpp:5
↓ 1 callersFunctionfib
Tabulation
21. Dynamic Programming/02 Nth Fibonacci/02c Nth Fibonacci.cpp:5
↓ 1 callersFunctionfib
Memoization
21. Dynamic Programming/02 Nth Fibonacci/02b Nth Fibonacci.cpp:7
↓ 1 callersFunctionfibonacci
04. Recursion/07 Nth Fibonacci/07 Nth Fibonacci.cpp:7
↓ 1 callersFunctionfirstOccurrence
06. Searching/04 Count Occurrences/04b.cpp:4
↓ 1 callersFunctionfirstOccurrence
time: O(n)
06. Searching/02 Index of First Occurrence/02a.cpp:5
↓ 1 callersFunctionfirstOccurrence
time: O(logn)
06. Searching/02 Index of First Occurrence/02b.cpp:5
↓ 1 callersFunctionfirstOccurrence
time: O(logn) space: O(logn)
06. Searching/02 Index of First Occurrence/02c.cpp:6
↓ 1 callersFunctionfreq
Time: O(n) Space: O(1)
10. Strings/03 Print Frequencies of Character/03 Print Frequencies of Character in String.cpp:6
↓ 1 callersFunctionfrequencies
09. Hashing/04 Frequencies of Elements/04a Frequencies of Elements.cpp:4
↓ 1 callersFunctionfrequencies
09. Hashing/04 Frequencies of Elements/04b Frequencies of Elements.cpp:4
↓ 1 callersFunctionfun
converts decimal to binary
04. Recursion/02 Guess Output/02d Guess Output.cpp:5
↓ 1 callersFunctionfun
04. Recursion/02 Guess Output/02a Guess Output.cpp:4
↓ 1 callersFunctionfun
04. Recursion/02 Guess Output/02b Guess Output.cpp:4
↓ 1 callersFunctionfun
04. Recursion/02 Guess Output/02c Guess Output.cpp:9
↓ 1 callersFunctionfun
04. Recursion/01 Introduction/02 Basic Recursion.cpp:4
↓ 1 callersFunctionfun1
04. Recursion/01 Introduction/01 Function Calls.cpp:4
↓ 1 callersFunctionfun2
04. Recursion/01 Introduction/01 Function Calls.cpp:9
↓ 1 callersMethodgetMax
14. Deque/04 Data Structure with Min Max Operation/04.cpp:34
↓ 1 callersFunctiongetMaxArea
time: O(n*n) space: O(1)
12. Stacks/10 Largest Rectangular Area/10a Largest Rectangluar Area.cpp:6
↓ 1 callersFunctiongetMaxArea
time: O(n) space: O(n)
12. Stacks/10 Largest Rectangular Area/10b Largest Rectangluar Area.cpp:6
↓ 1 callersMethodgetMin
14. Deque/04 Data Structure with Min Max Operation/04.cpp:29
↓ 1 callersFunctiongetSuccessor
Recursive Implementation Time: O(logN) Space: O(logN) successor is the left most leaf of the right child
16. Binary Search Tree/03 Delete in BST/03 Delete in BST.cpp:23
↓ 1 callersFunctionhcf
02. Mathematics/06 LCM of two Numbers/06b.cpp:13
↓ 1 callersFunctionheapSort
17. Heaps/09 Heap Sort/09 Heap Sort.cpp:27
↓ 1 callersFunctionheight
15. Binary Tree/10 Level Order Traversal Line by Line/10a.cpp:19
↓ 1 callersFunctionheight
Time: O(N) Space: O(H)
15. Binary Tree/07 Height of Tree/07.cpp:21
↓ 1 callersFunctionheight
15. Binary Tree/09 Level Order Traversal/09a.cpp:19
↓ 1 callersFunctionhoareParition
07. Sorting/15 Quick Sort/15c Quick Sort using Hoare Partition.cpp:4
↓ 1 callersFunctionhoareParition
considering first element as the pivot element
07. Sorting/14 Hoare Partition/14a Hoare Partition.cpp:5
↓ 1 callersFunctionhoareParition
pivot given by user
07. Sorting/14 Hoare Partition/14b Hoare Partition.cpp:5
↓ 1 callersFunctioninorder
Time: O(N) Space: O(H) Inorder: left Root Right
15. Binary Tree/04 Inorder Traversal/04.cpp:22
↓ 1 callersFunctioninsert
Time: O(n) insert at begin Time: O(1) insert at end
05. Arrays/02 Insert/02 Insert.cpp:6
↓ 1 callersFunctioninsert
Recursive Implementation Time: O(logN) Space: O(logN)
16. Binary Search Tree/02 Insert in BST/02a Insert in BST.cpp:22
↓ 1 callersFunctioninsert
Iterative Implementation Time: O(logN) Space: O(1)
16. Binary Search Tree/02 Insert in BST/02b Insert in BST.cpp:22
↓ 1 callersFunctioninsertAtHead
Time: O(1) Space: O(1)
11. Linked List/23 Circular Doubly Linked List/23 Circular Doubly Linked List.cpp:21
↓ 1 callersFunctioninsertAtHead
Time: O(1) Space: O(1)
11. Linked List/12 Insert At Head Doubly LL/12 Insert At Head Doubly LL.cpp:21
↓ 1 callersFunctioninsertAtHead
Time: O(N) Space: O(1)
11. Linked List/19 Insert At Head Circular LL/19a Insert At Head Circular LL.cpp:19
↓ 1 callersFunctioninsertAtHead
Time: O(1) Space: O(1)
11. Linked List/19 Insert At Head Circular LL/19b Insert At Head Circular LL.cpp:19
↓ 1 callersFunctioninsertAtHead
Time: O(1) Space: O(1)
11. Linked List/03 Recursive Traversal/04 Insert at Head.cpp:19
↓ 1 callersFunctioninsertAtPosition
Time: O(N) Space: O(1)
11. Linked List/08 Insert At Given Position/08 Insert At Given Position.cpp:19
↓ 1 callersFunctioninsertAtTail
Time: O(N) Space: O(1)
11. Linked List/20 Insert At Tail Circular LL/20 Insert At Tail Circular LL.cpp:19
↓ 1 callersFunctioninsertAtTail
Time: O(N) Space: O(1)
11. Linked List/05 Insert At Tail/05 Insert At Tail.cpp:19
↓ 1 callersFunctioninsertAtTail
Time: O(N) Space: O(1)
11. Linked List/13 Insert At Tail Doubly LL/13 Insert At Tail Doubly LL.cpp:21
↓ 1 callersFunctioninsertionSort
time: O(n*n) space: O(1)
07. Sorting/05 Insertion Sort/05 Insertion Sort.cpp:13
↓ 1 callersFunctionintersection
returns count of elements which are same in both
09. Hashing/05 Intersection of Arrays/05a Intersection of Arrays.cpp:5
↓ 1 callersFunctionintersection
09. Hashing/05 Intersection of Arrays/05c Intersection of Arrays.cpp:4
↓ 1 callersFunctionintersection
09. Hashing/05 Intersection of Arrays/05b Intersection of Arrays.cpp:4
↓ 1 callersFunctionintersection
07. Sorting/08 Intersection of Two Sorted Arrays/08b Intersection of two Sorted Arrays.cpp:4
↓ 1 callersFunctionintersection
07. Sorting/08 Intersection of Two Sorted Arrays/08a Intersection of two Sorted Arrays.cpp:4
↓ 1 callersFunctionintersectionPoint
Time: O(N) Space: O(N)
11. Linked List/36 Intersection Point of Two Linked Lists/36a Intersection Point of Two Linked Lists.cpp:19
↓ 1 callersFunctionintersectionPoint
Time: O(N) Space: O(1)
11. Linked List/36 Intersection Point of Two Linked Lists/36b Intersection Point of Two Linked Lists.cpp:19
↓ 1 callersFunctionisAnagram
10. Strings/10 Check for Anagram/10b Check for Anagram.cpp:7
↓ 1 callersFunctionisAnagram
10. Strings/10 Check for Anagram/10a Check for Anagram.cpp:15
↓ 1 callersFunctionisAnagram
10. Strings/15 Anagram Search/15a Anagram Search.cpp:4
↓ 1 callersFunctionisAnagramPresent
Time: O(m) Space: O(1)
10. Strings/15 Anagram Search/15b Anagram Search.cpp:19
↓ 1 callersFunctionisAnagramPresent
Time: O((n-m+1)*m) Space: O(1)
10. Strings/15 Anagram Search/15a Anagram Search.cpp:33
↓ 1 callersFunctionisBalanced
12. Stacks/04 Balanced Parentheses/04 Balanced Parentheses.cpp:9
↓ 1 callersFunctionisDistinct
10. Strings/18 Longest Substring with Distinct Characters/18a Longest Substring with Distinct Characters.cpp:4
↓ 1 callersFunctionisEquilibrium
time: O(n*n)
05. Arrays/27 Find Equlibrium Point/27a Find Equlibrium Point.cpp:11
↓ 1 callersFunctionisEquilibrium
time: O(n)
05. Arrays/27 Find Equlibrium Point/27b Find Equlibrium Point.cpp:5
↓ 1 callersFunctionisPalindrome
10. Strings/08 Palindrome Check/08a Palindrome Check.cpp:13
↓ 1 callersFunctionisPalindrome
10. Strings/08 Palindrome Check/08b Palindrome Check.cpp:7
↓ 1 callersFunctionisPalindrome
time: O(log10(n)) space: O(1)
02. Mathematics/02 Palindrome Numbers/02.cpp:11
↓ 1 callersFunctionisPossible
06. Searching/17 Allocate Minimum Pages/17.cpp:4
↓ 1 callersFunctionisPower
Brian Kerningham's Algorithm
03. Bit Manipulation/04 Power of Two/04b check power of two.cpp:5
↓ 1 callersFunctionisPower
03. Bit Manipulation/04 Power of Two/04a check power of two.cpp:20
↓ 1 callersFunctionisPrime
02. Mathematics/10 Sieve of Eratosthenes/10a.cpp:9
↓ 1 callersFunctionisPrime
time: O(sqrt(n)) space: O(1)
02. Mathematics/07 Check for Prime/07b.cpp:11
↓ 1 callersFunctionisPrime
time: O(n) space: O(1)
02. Mathematics/07 Check for Prime/07a.cpp:11
↓ 1 callersFunctionisPrime
time: O(sqrt(n)) space: O(1) efficient for large values of n
02. Mathematics/07 Check for Prime/07c.cpp:12
↓ 1 callersFunctionisPrime
02. Mathematics/08 Prime Factors/08a.cpp:9
↓ 1 callersFunctionisRotated
10. Strings/14 Check Rotation/14b Check if Strings are Rotation.cpp:7
↓ 1 callersFunctionisRotated
Time: O(n^2) Space: O(1)
10. Strings/14 Check Rotation/14a Check if Strings are Rotation.cpp:16
↓ 1 callersFunctionisSafe
20. Backtracking/02 Rat in a Maze/02 Rat in a Maze.cpp:19
↓ 1 callersFunctionisSubsequence
10. Strings/09 Validate Subsequence/09b Validate Subsequence.cpp:7
↓ 1 callersFunctionisSubsequence
10. Strings/09 Validate Subsequence/09a Validate Subsequence.cpp:19
↓ 1 callersFunctionisSum
09. Hashing/09 Subarray with Given Sum/09b SubArray with given Sum.cpp:4
↓ 1 callersFunctionisSum
09. Hashing/09 Subarray with Given Sum/09a SubArray with given Sum.cpp:4
↓ 1 callersFunctionisTriplet
time: O(n*n*n)
06. Searching/14 Check if there exists a Triplet with Given Condition/14a.cpp:10
↓ 1 callersFunctionisTriplet
time: O(n*n)
06. Searching/14 Check if there exists a Triplet with Given Condition/14b.cpp:5
← previousnext →201–300 of 1,161, ranked by callers