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
-[Problem sets from textbook](https://www.amazon.com/Data-Structure-Algorithmic-Thinking-Python/dp/8192107590)
30
-
-[Online programming](https://leetcode.com/)
31
-
32
-
## 1. Orientation to the Machine Learning Foundations Series
33
-
34
-
-[Data Structures, Algorithms, and Machine Learning Optimization](https://www.oreilly.com/library/view/data-structures-algorithms/9780137644889/)
35
-
- The foundations should be strong. By large, CS concepts are standalone (no need for linear algebra, ...) 
11
+
# 1. Foundation
12
+
- By large, CS concepts can be standalone. However, you might need to build upon other elements. For instance, in ML, there is a need for Linear Algebra, Calculus and Statistics.
13
+

36
14
- Reasons for using DSA in ML:
37
15
- Finding the correct DS for various situations
38
16
- Be thoughtful for time/space complexity in:
39
17
- Model Training
40
-
- Model deployment in larger scale
41
-
-**Software 2.0:** Assuming the fixed batch size, Deep Learning algos typically have **constant time (Compute)/space(RAM)** complexity
42
-
- We also learn how to implement ML models as graphs
43
-
- Low-level PyTorch
18
+
- Model deployment in larger scale
19
+
- Software 2.0: Assuming the fixed batch size, Deep Learning algos typically have a constant time/space complexity (GPU/RAM)
20
+
- Implement ML models as graphs
44
21
45
-
## 2. Big O Notion
22
+
Source: [Data Structures, Algorithms, and Machine Learning Optimization](https://www.oreilly.com/library/view/data-structures-algorithms/9780137644889/)
23
+
# 2. Big O Notion
46
24
47
25

48
26
@@ -58,7 +36,13 @@ We keep the *m*. Given that in might be large. 
58
36
59
37
# 3. Data structures
60
38
61
-
List 
39
+
40
+
- List based data structures:
41
+

42
+
- Common data structures:
43
+

44
+
- Big O notion
45
+

62
46
63
47
Linked lists are not indexed. Only nodes are linked toghether. 
64
48
@@ -68,17 +52,15 @@ Linked lists are not indexed. Only nodes are linked toghether.  (Double ended- queue):
70
54
71
-
# Data Structures and Algorithms (CS)
55
+
# 4. Algorithms
72
56
73
57
The summary of **Data Structures and Algorithms** plus **Interview steps** from Udacity's nano degree "Data Structures and Algorithms".
74
58
75
59
I’ve included the code for each concept in Python in the code folder. I would suggest to implement short codes for your projects or coding interviews.
76
60
77
-
#How to solving algorithm problems:
61
+
## Solution to any problems
78
62
79
-

80
-
81
-
Think in simple term:
63
+
Think in simple terms:
82
64
83
65
1. What are the inputs
84
66
2. What are the outputs
@@ -104,11 +86,12 @@ Q: For inputs (dates), what are the valid inputs? Q: How input are encoded? (yyy
104
86
105
87
Tips: Break into simple parts so that we can see our progress. Write simple small codes that work No need to figure out all the details.
106
88
107
-
# Concepts:
89
+

90
+
108
91
109
92
Now we look into the main topics that are being covered in most interviews/coding challenges. We also look into the patterns that appear in solutions which can be used in new problems. The goal is to understand the fundamentals and try to use them to solve problems.
110
93
111
-
## Big O Notion:
94
+
## Big O Notion
112
95
113
96
As the input to an algorithm increases, the time required to run the algorithm may also increase.
114
97
@@ -148,13 +131,14 @@ Int , float 4 bytes
148
131
149
132
char 1 byte
150
133
151
-
## Comparison
152
-
153
-
Finding the smallest of n numbers:(n-1)
154
-
Finding the biggest of n numbers:(n-1)
155
-
Finding the smallest and the biggest of n numbers:(2n-3)
156
-
157
-
## Search
134
+
## Binary Search
135
+
What are time complexity of the following problems?
136
+
Finding the smallest of n numbers?
137
+
• O(n-1)
138
+
Finding the biggest of n numbers?
139
+
• O(n-1)
140
+
Finding the smallest and the biggest of n numbers?
141
+
• O(2n-3)
158
142
159
143
**Binary search (Middle …. Middle, O (log(n)).:**
160
144
@@ -172,13 +156,13 @@ Finding the smallest and the biggest of n numbers:(2n-3)
172
156
173
157
Middle, Middle, Middle.
174
158
175
-
## Sorting:
159
+
## Sorting
176
160
177
161
**Bubble sort:**
178
162
179
163
Simplest and most inefficient one O(n\^2)
180
164
181
-
## Merge Sort (divide, merge):
165
+
**Merge Sort:**
182
166
183
167
Using divide and conquer, first, we divide 2 by 2
184
168
@@ -194,7 +178,7 @@ O (n Log (n))
194
178
195
179
Why we are seeing log (n) in our efficiency? Hint: same as binary search problem
196
180
197
-
## Quick Sort (divide, merge):
181
+
**Quick Sort:**
198
182
199
183
Pick one and move it around
200
184
@@ -240,9 +224,9 @@ Everythin less than 8 are already below 8 so cemented
240
224
241
225
**Efficiency:**
242
226
243
-
**O(n2) if it’s already sorted. Why? Wasting time**
227
+
O(n2) if it’s already sorted. Why? Wasting time
244
228
245
-
## Dynamic programming:
229
+
## Dynamic Programming
246
230
247
231
(Programming == tables)
248
232
@@ -315,7 +299,8 @@ Suppose this number not a prime? 1324 if the answer is no it can be verified qui
315
299
316
300
Class Co-NP: \_No\_ polytime
317
301
318
-
## Greedy Algorithm (Best option at each step):
302
+
## Greedy Algorithm
303
+
(Best option at each step)
319
304
320
305

321
306
@@ -333,8 +318,8 @@ Example:
333
318
334
319
Min operations example {see code}: By using while, in dividing numbers in half // == / and using
335
320
336
-
## Graph algorithm (data structure that shows relation):
337
-
321
+
## Graph Algorithm
322
+
(data structure that shows relation)
338
323
Graph(Tree is a subgroup of graph,Network) Nodes(Vertex) Edges
339
324
340
325

@@ -359,7 +344,7 @@ Let’s define 3 variables
359
344
360
345
Final answer we be the best solution out of these both (A[i] B[i] )
361
346
362
-
# Technical Interview
347
+
# 5. Technical Interview
363
348
364
349
Now lets focus on the technical interviews. We tend to simplify the concepts by using memory palace techniques. I adivse everyone to develop a memory palace for algorithms/techniques that requrie knowledge about more than 6-7 steps.
365
350
@@ -448,16 +433,28 @@ Test cases: input None -\> return 0 so its working
448
433
449
434
So [[1,0,1],[1,1,0). Go ahead, that looks good. Now I’m adding both of these. And I probably {} O looks like I forget to {add a return} Looks like it works.
0 commit comments