#leetcode
Read more stories on Hashnode
Articles with this tag
Recursion is a fundamental programming concept where a function calls itself until a specified base condition is met. While it is a powerful tool for...
Tree is a hierarchical data structure that consists of nodes connected by edges. It is a non-linear structure, which means that unlike arrays, linked...
Definition: It is a non linear data structure used to represent relationships between nodes(vertices) through edges(links) Formulas No of Edges:...
Linked lists are a fundamental data structure in computer science, used to store a collection of elements. They consist of nodes, where each node...
Remove duplicates in-place from sorted array int removeDuplicates(vector<int>& arr, int n) { if (n == 0) return 0; int i = 0; for (int j...
Bubble Sort Time Complexity: Bubble Sort Time Complexity: Best: O(n2) (when the array is already sorted) Average: O(n2) Worst: O(n2) Space Complexity:...