Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/devparthgarg/Data-Structures-and-Algorithms
/ functions
Functions
1,161 in github.com/devparthgarg/Data-Structures-and-Algorithms
⨍
Functions
1,161
◇
Types & classes
111
↓ 1 callers
Function
dfsRec
18. Graphs/05 Depth First Search/05b Depth First Search.cpp:4
↓ 1 callers
Function
dfsRec
18. Graphs/05 Depth First Search/05c Depth First Search.cpp:4
↓ 1 callers
Function
dfsRec
18. Graphs/05 Depth First Search/05a Depth First Search.cpp:4
↓ 1 callers
Function
diameter
15. Binary Tree/20 Diameter of Binary Tree/20.cpp:22
↓ 1 callers
Function
display
17. Heaps/11 Sort K Sorted Array/11b Sort K-Sorted Array.cpp:39
↓ 1 callers
Function
display
17. Heaps/11 Sort K Sorted Array/11a Sort K-Sorted Array.cpp:15
↓ 1 callers
Function
display
08. Matrix/06 Spiral Traversal/06 Spiral Traversal.cpp:51
↓ 1 callers
Function
distinctInKSizeWindow
09. Hashing/14 Count Distinct Elements in a Window of size K/14b Count Distinct Elements in Window of size K.cpp:4
↓ 1 callers
Function
distinctInKSizeWindow
09. Hashing/14 Count Distinct Elements in a Window of size K/14a Count Distinct Elements in Window of size K.cpp:4
↓ 1 callers
Function
distinctInKSizeWindow
09. Hashing/14 Count Distinct Elements in a Window of size K/14c Count Distinct Elements in Window of size K.cpp:4
↓ 1 callers
Function
editDistance
Recursion
21. Dynamic Programming/05 Edit Distance/05a Edit Distance.cpp:10
↓ 1 callers
Function
editDistance
Tabulation
21. Dynamic Programming/05 Edit Distance/05c Edit Distance.cpp:10
↓ 1 callers
Function
editDistance
Memoization
21. Dynamic Programming/05 Edit Distance/05b Edit Distance.cpp:12
↓ 1 callers
Method
empty
12. Stacks/02 Implementation/02c Implementation using Linked List.cpp:67
↓ 1 callers
Method
empty
12. Stacks/02 Implementation/02b Implementation using Vectors.cpp:34
↓ 1 callers
Function
factorial
time: O(n) space: O(n)
02. Mathematics/03 Factorial of a Number/03b.cpp:10
↓ 1 callers
Function
factorial
time: O(n) space: O(1)
02. Mathematics/03 Factorial of a Number/03a.cpp:10
↓ 1 callers
Function
factorial
02. Mathematics/04 Trailing Zeroes in Factorial/04a.cpp:9
↓ 1 callers
Function
factorial
04. Recursion/06 Factorial/06 Factorial of Number.cpp:7
↓ 1 callers
Function
fib
Recursion
21. Dynamic Programming/02 Nth Fibonacci/02a Nth Fibonacci.cpp:5
↓ 1 callers
Function
fib
Tabulation
21. Dynamic Programming/02 Nth Fibonacci/02c Nth Fibonacci.cpp:5
↓ 1 callers
Function
fib
Memoization
21. Dynamic Programming/02 Nth Fibonacci/02b Nth Fibonacci.cpp:7
↓ 1 callers
Function
fibonacci
04. Recursion/07 Nth Fibonacci/07 Nth Fibonacci.cpp:7
↓ 1 callers
Function
firstOccurrence
06. Searching/04 Count Occurrences/04b.cpp:4
↓ 1 callers
Function
firstOccurrence
time: O(n)
06. Searching/02 Index of First Occurrence/02a.cpp:5
↓ 1 callers
Function
firstOccurrence
time: O(logn)
06. Searching/02 Index of First Occurrence/02b.cpp:5
↓ 1 callers
Function
firstOccurrence
time: O(logn) space: O(logn)
06. Searching/02 Index of First Occurrence/02c.cpp:6
↓ 1 callers
Function
freq
Time: O(n) Space: O(1)
10. Strings/03 Print Frequencies of Character/03 Print Frequencies of Character in String.cpp:6
↓ 1 callers
Function
frequencies
09. Hashing/04 Frequencies of Elements/04a Frequencies of Elements.cpp:4
↓ 1 callers
Function
frequencies
09. Hashing/04 Frequencies of Elements/04b Frequencies of Elements.cpp:4
↓ 1 callers
Function
fun
converts decimal to binary
04. Recursion/02 Guess Output/02d Guess Output.cpp:5
↓ 1 callers
Function
fun
04. Recursion/02 Guess Output/02a Guess Output.cpp:4
↓ 1 callers
Function
fun
04. Recursion/02 Guess Output/02b Guess Output.cpp:4
↓ 1 callers
Function
fun
04. Recursion/02 Guess Output/02c Guess Output.cpp:9
↓ 1 callers
Function
fun
04. Recursion/01 Introduction/02 Basic Recursion.cpp:4
↓ 1 callers
Function
fun1
04. Recursion/01 Introduction/01 Function Calls.cpp:4
↓ 1 callers
Function
fun2
04. Recursion/01 Introduction/01 Function Calls.cpp:9
↓ 1 callers
Method
getMax
14. Deque/04 Data Structure with Min Max Operation/04.cpp:34
↓ 1 callers
Function
getMaxArea
time: O(n*n) space: O(1)
12. Stacks/10 Largest Rectangular Area/10a Largest Rectangluar Area.cpp:6
↓ 1 callers
Function
getMaxArea
time: O(n) space: O(n)
12. Stacks/10 Largest Rectangular Area/10b Largest Rectangluar Area.cpp:6
↓ 1 callers
Method
getMin
14. Deque/04 Data Structure with Min Max Operation/04.cpp:29
↓ 1 callers
Function
getSuccessor
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 callers
Function
hcf
02. Mathematics/06 LCM of two Numbers/06b.cpp:13
↓ 1 callers
Function
heapSort
17. Heaps/09 Heap Sort/09 Heap Sort.cpp:27
↓ 1 callers
Function
height
15. Binary Tree/10 Level Order Traversal Line by Line/10a.cpp:19
↓ 1 callers
Function
height
Time: O(N) Space: O(H)
15. Binary Tree/07 Height of Tree/07.cpp:21
↓ 1 callers
Function
height
15. Binary Tree/09 Level Order Traversal/09a.cpp:19
↓ 1 callers
Function
hoareParition
07. Sorting/15 Quick Sort/15c Quick Sort using Hoare Partition.cpp:4
↓ 1 callers
Function
hoareParition
considering first element as the pivot element
07. Sorting/14 Hoare Partition/14a Hoare Partition.cpp:5
↓ 1 callers
Function
hoareParition
pivot given by user
07. Sorting/14 Hoare Partition/14b Hoare Partition.cpp:5
↓ 1 callers
Function
inorder
Time: O(N) Space: O(H) Inorder: left Root Right
15. Binary Tree/04 Inorder Traversal/04.cpp:22
↓ 1 callers
Function
insert
Time: O(n) insert at begin Time: O(1) insert at end
05. Arrays/02 Insert/02 Insert.cpp:6
↓ 1 callers
Function
insert
Recursive Implementation Time: O(logN) Space: O(logN)
16. Binary Search Tree/02 Insert in BST/02a Insert in BST.cpp:22
↓ 1 callers
Function
insert
Iterative Implementation Time: O(logN) Space: O(1)
16. Binary Search Tree/02 Insert in BST/02b Insert in BST.cpp:22
↓ 1 callers
Function
insertAtHead
Time: O(1) Space: O(1)
11. Linked List/23 Circular Doubly Linked List/23 Circular Doubly Linked List.cpp:21
↓ 1 callers
Function
insertAtHead
Time: O(1) Space: O(1)
11. Linked List/12 Insert At Head Doubly LL/12 Insert At Head Doubly LL.cpp:21
↓ 1 callers
Function
insertAtHead
Time: O(N) Space: O(1)
11. Linked List/19 Insert At Head Circular LL/19a Insert At Head Circular LL.cpp:19
↓ 1 callers
Function
insertAtHead
Time: O(1) Space: O(1)
11. Linked List/19 Insert At Head Circular LL/19b Insert At Head Circular LL.cpp:19
↓ 1 callers
Function
insertAtHead
Time: O(1) Space: O(1)
11. Linked List/03 Recursive Traversal/04 Insert at Head.cpp:19
↓ 1 callers
Function
insertAtPosition
Time: O(N) Space: O(1)
11. Linked List/08 Insert At Given Position/08 Insert At Given Position.cpp:19
↓ 1 callers
Function
insertAtTail
Time: O(N) Space: O(1)
11. Linked List/20 Insert At Tail Circular LL/20 Insert At Tail Circular LL.cpp:19
↓ 1 callers
Function
insertAtTail
Time: O(N) Space: O(1)
11. Linked List/05 Insert At Tail/05 Insert At Tail.cpp:19
↓ 1 callers
Function
insertAtTail
Time: O(N) Space: O(1)
11. Linked List/13 Insert At Tail Doubly LL/13 Insert At Tail Doubly LL.cpp:21
↓ 1 callers
Function
insertionSort
time: O(n*n) space: O(1)
07. Sorting/05 Insertion Sort/05 Insertion Sort.cpp:13
↓ 1 callers
Function
intersection
returns count of elements which are same in both
09. Hashing/05 Intersection of Arrays/05a Intersection of Arrays.cpp:5
↓ 1 callers
Function
intersection
09. Hashing/05 Intersection of Arrays/05c Intersection of Arrays.cpp:4
↓ 1 callers
Function
intersection
09. Hashing/05 Intersection of Arrays/05b Intersection of Arrays.cpp:4
↓ 1 callers
Function
intersection
07. Sorting/08 Intersection of Two Sorted Arrays/08b Intersection of two Sorted Arrays.cpp:4
↓ 1 callers
Function
intersection
07. Sorting/08 Intersection of Two Sorted Arrays/08a Intersection of two Sorted Arrays.cpp:4
↓ 1 callers
Function
intersectionPoint
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 callers
Function
intersectionPoint
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 callers
Function
isAnagram
10. Strings/10 Check for Anagram/10b Check for Anagram.cpp:7
↓ 1 callers
Function
isAnagram
10. Strings/10 Check for Anagram/10a Check for Anagram.cpp:15
↓ 1 callers
Function
isAnagram
10. Strings/15 Anagram Search/15a Anagram Search.cpp:4
↓ 1 callers
Function
isAnagramPresent
Time: O(m) Space: O(1)
10. Strings/15 Anagram Search/15b Anagram Search.cpp:19
↓ 1 callers
Function
isAnagramPresent
Time: O((n-m+1)*m) Space: O(1)
10. Strings/15 Anagram Search/15a Anagram Search.cpp:33
↓ 1 callers
Function
isBalanced
12. Stacks/04 Balanced Parentheses/04 Balanced Parentheses.cpp:9
↓ 1 callers
Function
isDistinct
10. Strings/18 Longest Substring with Distinct Characters/18a Longest Substring with Distinct Characters.cpp:4
↓ 1 callers
Function
isEquilibrium
time: O(n*n)
05. Arrays/27 Find Equlibrium Point/27a Find Equlibrium Point.cpp:11
↓ 1 callers
Function
isEquilibrium
time: O(n)
05. Arrays/27 Find Equlibrium Point/27b Find Equlibrium Point.cpp:5
↓ 1 callers
Function
isPalindrome
10. Strings/08 Palindrome Check/08a Palindrome Check.cpp:13
↓ 1 callers
Function
isPalindrome
10. Strings/08 Palindrome Check/08b Palindrome Check.cpp:7
↓ 1 callers
Function
isPalindrome
time: O(log10(n)) space: O(1)
02. Mathematics/02 Palindrome Numbers/02.cpp:11
↓ 1 callers
Function
isPossible
06. Searching/17 Allocate Minimum Pages/17.cpp:4
↓ 1 callers
Function
isPower
Brian Kerningham's Algorithm
03. Bit Manipulation/04 Power of Two/04b check power of two.cpp:5
↓ 1 callers
Function
isPower
03. Bit Manipulation/04 Power of Two/04a check power of two.cpp:20
↓ 1 callers
Function
isPrime
02. Mathematics/10 Sieve of Eratosthenes/10a.cpp:9
↓ 1 callers
Function
isPrime
time: O(sqrt(n)) space: O(1)
02. Mathematics/07 Check for Prime/07b.cpp:11
↓ 1 callers
Function
isPrime
time: O(n) space: O(1)
02. Mathematics/07 Check for Prime/07a.cpp:11
↓ 1 callers
Function
isPrime
time: O(sqrt(n)) space: O(1) efficient for large values of n
02. Mathematics/07 Check for Prime/07c.cpp:12
↓ 1 callers
Function
isPrime
02. Mathematics/08 Prime Factors/08a.cpp:9
↓ 1 callers
Function
isRotated
10. Strings/14 Check Rotation/14b Check if Strings are Rotation.cpp:7
↓ 1 callers
Function
isRotated
Time: O(n^2) Space: O(1)
10. Strings/14 Check Rotation/14a Check if Strings are Rotation.cpp:16
↓ 1 callers
Function
isSafe
20. Backtracking/02 Rat in a Maze/02 Rat in a Maze.cpp:19
↓ 1 callers
Function
isSubsequence
10. Strings/09 Validate Subsequence/09b Validate Subsequence.cpp:7
↓ 1 callers
Function
isSubsequence
10. Strings/09 Validate Subsequence/09a Validate Subsequence.cpp:19
↓ 1 callers
Function
isSum
09. Hashing/09 Subarray with Given Sum/09b SubArray with given Sum.cpp:4
↓ 1 callers
Function
isSum
09. Hashing/09 Subarray with Given Sum/09a SubArray with given Sum.cpp:4
↓ 1 callers
Function
isTriplet
time: O(n*n*n)
06. Searching/14 Check if there exists a Triplet with Given Condition/14a.cpp:10
↓ 1 callers
Function
isTriplet
time: O(n*n)
06. Searching/14 Check if there exists a Triplet with Given Condition/14b.cpp:5
← previous
next →
201–300 of 1,161, ranked by callers