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
+23-1
Original file line number
Diff line number
Diff line change
@@ -147,6 +147,13 @@ Example:
147
147
148
148
Learn Big O. Make sure you give what would be the `runtime complexity` and `memory complexity`.
149
149
150
+
151
+
152
+
- Array.push() is O(1) constant time complexity
153
+
- string.indexOf() search is O(n) linear time complexity
154
+
- for loop O(n) linear time complexity
155
+
156
+
150
157
### Big O Space complexity
151
158
152
159
`Iterative functions` take no extra memory and therefore, `memory complexity` is `constant` O(1).
@@ -425,6 +432,10 @@ Below image showing how to add `[3, 7, 4, 6, 5, 1, 10, 2, 9, 8]` in BST.
425
432
-[Binary Search Tree Implementation Question](https://codepen.io/roopkt/pen/RwpJBOw?editors=0010)
426
433
-[Binary Search Tree Implementation Answer](https://codepen.io/roopkt/pen/LYWBYMM?editors=0010)
427
434
435
+
**Binary Search Algorithm**
436
+
437
+

438
+
428
439
Binary Search can be done both in iterative or recursive way.
429
440
430
441

@@ -516,12 +527,22 @@ Find all possible routes from `PHX` to `BKK`. Also then you can decide which pat
516
527
517
528
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