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
-[Find Median Values (With Merge Sort Algorithm)](#find-median-values-with-merge-sort-algorithm)
41
+
-[BFS (Breath First Search)](#bfs-breath-first-search)
42
+
-[Math & Stats](#math--stats)
43
+
-[Integer Division Without Using \* or /](#integer-division-without-using--or-)
44
+
-[Array slice](#array-slice)
45
+
-[Math.floor](#mathfloor)
46
+
-[Math.round](#mathround)
42
47
43
48
### What you should know before coding interview?
44
49
@@ -56,48 +61,54 @@ Example:
56
61
57
62
## What you should prepare?
58
63
59
-
### Big O
64
+
-[] DataStructure
65
+
-[] Algorithms
66
+
-[] Concepts
67
+
68
+
### Computer Science Concepts
69
+
70
+
-[] Big O Time
71
+
-[] Big O Space
72
+
-[] Recursion
73
+
-[] Memoization / Dynamic Programming
74
+
75
+
#### Big O Time complexity
60
76
61
77
Learn Big O. Make sure you give what would be the `runtime complexity` and `memory complexity`.
62
78
79
+
#### Big O Space complexity
80
+
63
81
`Iterative functions` take no extra memory and therefore, `memory complexity` is `constant` O(1).
64
82
65
83
`Recursive functions` take extra on the stack therefore, `memory complexity` is `lograrithmic` O(_logn_)
66
84
67
-
### Data Structures you should know
68
-
69
-
- Hash Table
70
-
- Linked List
71
-
- Stack
72
-
- Queue
73
-
- Tree
74
-
- Tries
75
-
- Graphs
76
-
- Vectors
77
-
- Heaps
85
+
#### Recursion
78
86
79
-
### Fundamental algorithms you should know
87
+
### Data Structures you should know
80
88
81
-
- Breadth-first search
82
-
- Depth-first search
83
-
- Merge sort & Quick sort
89
+
-[x] Array
90
+
-[] Hash Table
91
+
-[x] Linked List
92
+
-[] Stack
93
+
-[] Queue
94
+
-[] Tree
95
+
-[] Tries
96
+
-[] Graphs
97
+
-[] Heaps
98
+
-[] Vectors
99
+
100
+
### Algorithms you should know
101
+
102
+
-[x] Merge sort
103
+
-[] Quick sort
104
+
-[] Breadth-first search
105
+
-[] Depth-first search
106
+
-[x] Binary Search
84
107
85
108
## Working with this repo
86
109
87
110
Download or clone in local machine. Then run individual file in node console to see the results.
88
111
89
-
## Math & Stats
90
-
91
-
### Integer Division Without Using \* or /
92
-
93
-
Divide two integers without using '/' (division) or '\*' (multiplication) operators.
94
-
95
-
```shell
96
-
node .\src\math-and-stats\integer-division.js
97
-
```
98
-
99
-

100
-
101
112
## Mock Interview
102
113
103
114
### Get the Average value at each level of the tree
@@ -344,15 +355,18 @@ Example: Suppose you have given a tree structure and asked to calculate the aver
344
355
| Uses Stack to sort | Uses Queue to sort |
345
356
| Time complexity: Fast | Time complexity: Slow |
346
357
| Where to use: if you can find at root or leaf, find connected components. | Where to use: Find shortest path,find connected components. When you think you have less data go for it. |
358
+
| Time Complexity: O(V+E) | Time Complexity: O(V+E) |
347
359
348
-
## Sorting
360
+
## Algorithms
349
361
350
362
### Merge Sort
351
363
352
364
Browser's JavaScript Engine (`Array.prototype.sort`) uses merge sort maximum time. Runtime complexity O(n logn), Memory complexity O(n) because we have to create new list. It uses divide-and-conquer algorithm! and also it is recursive.
0 commit comments