You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-2
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,8 @@
2
2
3
3
### For Arrays: (methods that can be applied)
4
4
5
-
- sorting and then doing something, hashtable, two pointers in a loop are some of the operations that are popular to solve algos
5
+
- sorting and then doing something, hashtable, two pointers in a loop are some of the operations that are popular to solve algos.
6
+
Hash table can also be made for storing sum etc.
6
7
- to find all combinations use nested for loops (worst algos)
7
8
- another way is to stop at an element and traverse all its previous elements
8
9
- fixing one number and having two pointers one at start and one at end to make some operation
@@ -13,13 +14,17 @@ only if there is one number that repeats odd number of times
13
14
- If element in an array is to be found, and length is known apply binary search. Will complete the search in O(logn) times. If binary search cant be applied look in sizes of k at a time to limit the search set.
14
15
- We cannot find time complexity of something whose input size is unknown.
15
16
17
+
# General hash functions
18
+
- take mod with number of elements present
19
+
16
20
#Topic0: Programming Questions
17
21
18
22
TODO:
19
23
- question14.c (general),
20
24
- question17.c (arrays), to be done after trees and linkedlist is done
21
25
- question18.c (arrays), to be done after linkedlist is done
22
26
- question19.c (arrays): to be done after trees is done
27
+
- question20.c (arrays): to be done after hashing (approach 2 and 3)
23
28
24
29
## Note:
25
30
**Questions statements are included in the file itself**
@@ -79,10 +84,11 @@ TODO:
79
84
-[Given an array A, find two elements whose sum is closest to zero](/arrays/question14.c)
80
85
-[Find the triplet in given array that sum to given value 'x'](/arrays/question15.c)
81
86
-[Find the equilibrium index of an array](/arrays/question16.c)
82
-
-[In an array of unknown size having all 0s at one side and all 1s at other, find the index where 1st 1 exists.](/arrays/question17.c) - STILL TO BE DONE
87
+
-[In an array of unknown size having all 0s at one side and all 1s at other, find the index where 1st 1 exists.](/arrays/question17.c)
83
88
-[Given an array and an integer K, find max element for each and every contiguous subarray of size k](/arrays/question18.c)
84
89
-[Count number of smaller elements on the right of each element in an array](/arrays/question19.c)
85
90
-[Find the subarray with the given sum](/arrays/question20.c)
91
+
-[Consider and array which contains only 0's and 1's. Find largest sub array which contains only 0's and 1's](/arrays/question21.c)
0 commit comments