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
↓ 99 callers
Method
size
13. Queue/03_Implement_Stack_using_Queue.cpp:52
↓ 82 callers
Method
push
13. Queue/03_Implement_Stack_using_Queue.cpp:15
↓ 46 callers
Method
empty
12. Stacks/02 Implementation/02a Implementation using Arrays.cpp:54
↓ 46 callers
Method
insert
17. Heaps/07 Delete/07 Delete.cpp:34
↓ 38 callers
Method
pop
13. Queue/03_Implement_Stack_using_Queue.cpp:31
↓ 23 callers
Method
push
12. Stacks/06 K Stacks in an Array/06 K Stacks in an Array.cpp:43
↓ 20 callers
Method
top
13. Queue/03_Implement_Stack_using_Queue.cpp:42
↓ 13 callers
Function
min
21. Dynamic Programming/05 Edit Distance/05a Edit Distance.cpp:4
↓ 13 callers
Method
pop
12. Stacks/06 K Stacks in an Array/06 K Stacks in an Array.cpp:58
↓ 12 callers
Method
top
12. Stacks/02 Implementation/02a Implementation using Arrays.cpp:39
↓ 10 callers
Method
top
12. Stacks/12 Design Stack with getMin in O(1)/12b Design Stack with getMin in O(1).cpp:40
↓ 9 callers
Function
addEdge
18. Graphs/04 Breadth First Search/04c Breadth First Search.cpp:45
↓ 9 callers
Method
push
12. Stacks/02 Implementation/02a Implementation using Arrays.cpp:18
↓ 8 callers
Method
push
12. Stacks/02 Implementation/02c Implementation using Linked List.cpp:29
↓ 8 callers
Method
push
12. Stacks/02 Implementation/02b Implementation using Vectors.cpp:14
↓ 8 callers
Method
size
12. Stacks/02 Implementation/02a Implementation using Arrays.cpp:49
↓ 7 callers
Function
addEdge
18. Graphs/04 Breadth First Search/04a Breadth First Search.cpp:32
↓ 7 callers
Function
addEdge
18. Graphs/04 Breadth First Search/04b Breadth First Search.cpp:44
↓ 7 callers
Method
pop
12. Stacks/02 Implementation/02a Implementation using Arrays.cpp:29
↓ 6 callers
Function
addEdge
18. Graphs/05 Depth First Search/05a Depth First Search.cpp:27
↓ 6 callers
Method
pop
12. Stacks/02 Implementation/02c Implementation using Linked List.cpp:37
↓ 6 callers
Method
pop
12. Stacks/02 Implementation/02b Implementation using Vectors.cpp:19
↓ 5 callers
Function
addEdge
18. Graphs/06 Shortest Path in Unweighted Graph/06 Shortest Path in Unweighted Graph.cpp:32
↓ 5 callers
Function
addEdge
18. Graphs/08 Topological Sorting/08 Topological Sorting.cpp:44
↓ 5 callers
Method
addEdge
add edge
18. Graphs/03 Graphs Implementation/03a Graphs Implementation.cpp:30
↓ 5 callers
Function
isEmpty
22. Trie/03 Trie Delete.cpp:20
↓ 5 callers
Function
print
16. Binary Search Tree/09 Set STL/09a Set STL.cpp:4
↓ 5 callers
Method
top
12. Stacks/12 Design Stack with getMin in O(1)/12a Design Stack with getMin in O(1).cpp:40
↓ 4 callers
Function
addEdge
Adjacency List
18. Graphs/03 Graphs Implementation/03b Graphs Implementation.cpp:5
↓ 4 callers
Function
addEdge
18. Graphs/05 Depth First Search/05b Depth First Search.cpp:33
↓ 4 callers
Function
addEdge
18. Graphs/05 Depth First Search/05c Depth First Search.cpp:36
↓ 4 callers
Method
getMin
12. Stacks/12 Design Stack with getMin in O(1)/12b Design Stack with getMin in O(1).cpp:45
↓ 4 callers
Method
getMin
12. Stacks/12 Design Stack with getMin in O(1)/12a Design Stack with getMin in O(1).cpp:45
↓ 4 callers
Method
pop
12. Stacks/12 Design Stack with getMin in O(1)/12b Design Stack with getMin in O(1).cpp:30
↓ 4 callers
Function
print
14. Deque/03 Deque STL/03.cpp:4
↓ 4 callers
Method
print
14. Deque/04 Data Structure with Min Max Operation/04.cpp:49
↓ 4 callers
Method
push
12. Stacks/12 Design Stack with getMin in O(1)/12b Design Stack with getMin in O(1).cpp:13
↓ 4 callers
Function
reverse
10. Strings/13 Reverse Words in String/13b Reverse Words in String.cpp:4
↓ 3 callers
Function
getSum
time: O(n*q) q: number of queries
05. Arrays/26 Find Query Sum/26a Find Query Sum.cpp:5
↓ 3 callers
Function
getSum
time: O(1) (only time is taken by pre computation which is O(n))
05. Arrays/26 Find Query Sum/26b Find Query Sum.cpp:17
↓ 3 callers
Method
insertMax
14. Deque/04 Data Structure with Min Max Operation/04.cpp:24
↓ 3 callers
Method
insertMin
14. Deque/04 Data Structure with Min Max Operation/04.cpp:19
↓ 3 callers
Function
kthBit
Time: O(1)
03. Bit Manipulation/02 Check Kth Bit/02a check kth bit.cpp:9
↓ 3 callers
Function
kthBit
Time: O(1)
03. Bit Manipulation/02 Check Kth Bit/02b check kth bit.cpp:9
↓ 3 callers
Function
print
11. Linked List/40 Merge Two Sorted LL/40 Merge Two Sorted LL.cpp:53
↓ 3 callers
Method
push
12. Stacks/12 Design Stack with getMin in O(1)/12a Design Stack with getMin in O(1).cpp:13
↓ 3 callers
Method
push1
12. Stacks/05 Two Stacks in an Array/05 Two Stacks in an Array.cpp:24
↓ 3 callers
Function
reverse
05. Arrays/11 Left Rotate Array by D Spaces/11c Left Rotate Array by D Spaces.cpp:4
↓ 3 callers
Method
size
12. Stacks/02 Implementation/02b Implementation using Vectors.cpp:29
↓ 2 callers
Function
display
07. Sorting/13 Lomuto Partition/13b Lomuto Partitioning.cpp:27
↓ 2 callers
Function
display
07. Sorting/13 Lomuto Partition/13a Lomuto Partitioning.cpp:24
↓ 2 callers
Function
display
07. Sorting/12 Naive Partition/12 Naive Partitioning.cpp:47
↓ 2 callers
Function
display
07. Sorting/15 Quick Sort/15b Quick Sort using Lomuto Partition.cpp:37
↓ 2 callers
Function
display
07. Sorting/15 Quick Sort/15c Quick Sort using Hoare Partition.cpp:45
↓ 2 callers
Function
display
07. Sorting/05 Insertion Sort/05 Insertion Sort.cpp:28
↓ 2 callers
Function
display
07. Sorting/03 Bubble Sort/03a Bubble Sort.cpp:26
↓ 2 callers
Function
display
07. Sorting/03 Bubble Sort/03b Bubble Sort Optimized.cpp:26
↓ 2 callers
Function
display
07. Sorting/14 Hoare Partition/14a Hoare Partition.cpp:33
↓ 2 callers
Function
display
07. Sorting/14 Hoare Partition/14b Hoare Partition.cpp:35
↓ 2 callers
Function
display
07. Sorting/04 Selection Sort/04 Selection Sort.cpp:33
↓ 2 callers
Function
display
05. Arrays/08 Remove Duplicates from Sorted Array/08 Remove Duplicates from Sorted Array.cpp:20
↓ 2 callers
Function
display
05. Arrays/11 Left Rotate Array by D Spaces/11b Left Rotate Array by D Spaces.cpp:31
↓ 2 callers
Function
display
05. Arrays/11 Left Rotate Array by D Spaces/11a Left Rotate Array by D Spaces.cpp:19
↓ 2 callers
Function
display
05. Arrays/11 Left Rotate Array by D Spaces/11c Left Rotate Array by D Spaces.cpp:31
↓ 2 callers
Function
display
05. Arrays/10 Left Rotate Array by One/10 Left Rotate Array by One.cpp:15
↓ 2 callers
Function
display
05. Arrays/02 Insert/02 Insert.cpp:18
↓ 2 callers
Function
display
05. Arrays/07 Reverse Array/07 Reverse Array.cpp:22
↓ 2 callers
Function
display
05. Arrays/03 Delete/03 Delete.cpp:32
↓ 2 callers
Function
display
05. Arrays/09 Move Zeros to End/09a Move Zero to End.cpp:23
↓ 2 callers
Function
display
05. Arrays/09 Move Zeros to End/09b Move Zero to End.cpp:18
↓ 2 callers
Function
display
08. Matrix/05 Rotate/05 Rotate.cpp:31
↓ 2 callers
Function
divisors
time: O(sqrt(n)) space: O(1) order is not disturbed
02. Mathematics/09 Divisors of a Number/09c.cpp:12
↓ 2 callers
Function
divisors
time: O(sqrt(n)) space: O(1) order is disturbed
02. Mathematics/09 Divisors of a Number/09b.cpp:12
↓ 2 callers
Function
divisors
time: O(n) space: O(1)
02. Mathematics/09 Divisors of a Number/09a.cpp:11
↓ 2 callers
Function
floor
Iterative Implementation Time: O(logN) Space: O(1)
16. Binary Search Tree/04 Floor in BST/04 Floor in BST.cpp:29
↓ 2 callers
Function
hcf
time: O(min(a,b)) space: O(1)
02. Mathematics/05 GCD or HCF of two Numbers/05a.cpp:21
↓ 2 callers
Function
hcf
time: O(min(a,b)) space: O(1)
02. Mathematics/05 GCD or HCF of two Numbers/05b.cpp:31
↓ 2 callers
Function
hcf
time: O(log(min(a,b))) space: O(log(min(a,b))) optimised Euclid's Algo
02. Mathematics/05 GCD or HCF of two Numbers/05c.cpp:32
↓ 2 callers
Function
heapify
17. Heaps/09 Heap Sort/09 Heap Sort.cpp:4
↓ 2 callers
Function
height
15. Binary Tree/15 Check for Balanced Binary Tree/15a.cpp:19
↓ 2 callers
Function
isSame
10. Strings/15 Anagram Search/15b Anagram Search.cpp:4
↓ 2 callers
Function
kadane
05. Arrays/20 Max Circular Subarray Sum/20b Max Circular Subarray Sum.cpp:4
↓ 2 callers
Function
lcm
time: O(a*b) space: O(1)
02. Mathematics/06 LCM of two Numbers/06a.cpp:15
↓ 2 callers
Function
lcm
time: O(log(min(a,b))) space: O(log(min(a,b)))
02. Mathematics/06 LCM of two Numbers/06b.cpp:20
↓ 2 callers
Function
path
15. Binary Tree/21 LCA of Binary Tree/21a.cpp:19
↓ 2 callers
Method
pop
12. Stacks/12 Design Stack with getMin in O(1)/12a Design Stack with getMin in O(1).cpp:30
↓ 2 callers
Function
power
time: O(n) space: O(1)
02. Mathematics/11 Computing Power/11a.cpp:10
↓ 2 callers
Function
power
time: O(log(n)) space: O(logn(n))
02. Mathematics/11 Computing Power/11b.cpp:10
↓ 2 callers
Function
power
02. Mathematics/12 Iterative Power/12c.cpp:13
↓ 2 callers
Function
power
time: O(log(n)) space: O(1) optimised solution using bitwise operators
02. Mathematics/12 Iterative Power/12b.cpp:11
↓ 2 callers
Function
power
time: O(log(n)) space: O(1)
02. Mathematics/12 Iterative Power/12a.cpp:10
↓ 2 callers
Function
primeFactors
time: O(n*sqrt(n)) space: O(1)
02. Mathematics/08 Prime Factors/08a.cpp:39
↓ 2 callers
Function
primeFactors
time: O(sqrt(n)) space: O(1)
02. Mathematics/08 Prime Factors/08b.cpp:11
↓ 2 callers
Function
primeFactors
time: O(sqrt(n)) space: O(1) efficient for large values of n
02. Mathematics/08 Prime Factors/08c.cpp:12
↓ 2 callers
Function
print
11. Linked List/20 Insert At Tail Circular LL/20 Insert At Tail Circular LL.cpp:43
↓ 2 callers
Function
print
11. Linked List/28 Recursive Reverse of LL/28 Recursive Reverse of LL.cpp:32
↓ 2 callers
Function
print
11. Linked List/23 Circular Doubly Linked List/23 Circular Doubly Linked List.cpp:40
↓ 2 callers
Function
print
11. Linked List/07 Delete At Tail/07 Delete At Tail.cpp:46
↓ 2 callers
Function
print
11. Linked List/05 Insert At Tail/05 Insert At Tail.cpp:42
↓ 2 callers
Function
print
11. Linked List/12 Insert At Head Doubly LL/12 Insert At Head Doubly LL.cpp:36
next →
1–100 of 1,161, ranked by callers