Skip to content

Commit 74fbd3e

Browse files
committed
chore: fix checkbox
1 parent 0a30dc9 commit 74fbd3e

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

README.md

+44-44
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,16 @@ Example:
9090

9191
## What you should prepare?
9292

93-
- [] Computer Science Concepts
94-
- [] DataStructure
95-
- [] Algorithms
93+
- [ ] Computer Science Concepts
94+
- [ ] DataStructure
95+
- [ ] Algorithms
9696

9797
## Computer Science Concepts
9898

99-
- [] Big O Time
100-
- [] Big O Space
101-
- [] Recursion
102-
- [] Memoization / Dynamic Programming
99+
- [ ] Big O Time
100+
- [ ] Big O Space
101+
- [ ] Recursion
102+
- [ ] Memoization / Dynamic Programming
103103

104104
## Big O complexity
105105

@@ -163,7 +163,7 @@ Given a large array of integers and a window of size w, find the current maximum
163163

164164
Linked lists are dynamic data structure and memory is allocated at run time. They don't store data contiguously rather they use link to point to other elements.
165165

166-
![](https://i.imgur.com/tMN6TD5.png)
166+
![ ](https://i.imgur.com/tMN6TD5.png)
167167

168168
Performance wise linked lists are slower than arrays because there is no direct access to linked list elements.
169169

@@ -173,7 +173,7 @@ You have to copy 1,2 in new array then insert 3 and copy rest of the values. Run
173173

174174
Therefore, we use linked list to store 1-6 and we can easily insert 3 in between 2 and 4.
175175

176-
![](https://i.imgur.com/r689svn.png)
176+
![ ](https://i.imgur.com/r689svn.png)
177177

178178
The linked list is a list of items, called nodes. Nodes have two parts, `value` part and `link` part. Value part is used to stores the data. The link part is a reference, which is used to store addresses of the next element in the list.
179179

@@ -182,9 +182,9 @@ The linked list is a list of items, called nodes. Nodes have two parts, `value`
182182
- **Value**: The data that is stored in each node of the linked list.
183183
- **Link**: Link part of the node is used to store the reference of other node.
184184

185-
![](https://i.imgur.com/LeGU67n.png)
185+
![ ](https://i.imgur.com/LeGU67n.png)
186186

187-
![](https://i.imgur.com/nHFfpov.png)
187+
![ ](https://i.imgur.com/nHFfpov.png)
188188

189189
```ts
190190
class LinkedListNode {
@@ -201,31 +201,31 @@ Below are the types of LinkedList:
201201
- **Doubly Linked List**
202202
- **Circular Linked List**
203203

204-
![](https://i.imgur.com/byjRY7x.png)
204+
![ ](https://i.imgur.com/byjRY7x.png)
205205

206206
#### Insert at head
207207

208208
The newly created node will become head of the linked list. · Size of the list is increased by one.
209209

210-
![](https://i.imgur.com/79qwSqL.png)
210+
![ ](https://i.imgur.com/79qwSqL.png)
211211

212212
#### Insert at tail
213213

214-
![](https://i.imgur.com/Wz9Uovq.png)
214+
![ ](https://i.imgur.com/Wz9Uovq.png)
215215

216216
#### Reverse a Singly Linked List
217217

218218
We’re given the pointer/reference to the head of a singly linked list, reverse it and return the pointer/reference to the head of the reversed linked list.
219219

220-
![](https://i.imgur.com/lamsYrL.png)
220+
![ ](https://i.imgur.com/lamsYrL.png)
221221

222222
Problem Solving steps
223223

224-
![](https://i.imgur.com/0wZ4lB1.png)
224+
![ ](https://i.imgur.com/0wZ4lB1.png)
225225

226226
Running program output
227227

228-
![](https://i.imgur.com/FAHJMeF.png)
228+
![ ](https://i.imgur.com/FAHJMeF.png)
229229

230230
### Stack
231231

@@ -238,7 +238,7 @@ var stack = [1, 2, 3, 4];
238238
stack.pop(); // 4 , stack [1,2,3]
239239
stack.pop(); // 3 , stack [1,2]
240240
stack.pop(); // 2 , stack [1]
241-
stack.pop(); // 1 , stack []
241+
stack.pop(); // 1 , stack [ ]
242242
```
243243

244244
### Queue
@@ -248,7 +248,7 @@ Breadth First Search (BFS) uses a `queue` for storing the nodes that it is visit
248248
#### Enqueue an element in Queue
249249

250250
```ts
251-
var queue = [];
251+
var queue = [ ];
252252

253253
queue.push(1); // queue [1]
254254
queue.push(2); // queue [1,2]
@@ -262,7 +262,7 @@ var queue = [1, 2, 3, 4];
262262
queue.shift(); // 1 , queue [2,3,4]
263263
queue.shift(); // 2 , queue [3,4]
264264
queue.shift(); // 3 , queue [4]
265-
queue.shift(); // 4 , queue []
265+
queue.shift(); // 4 , queue [ ]
266266
```
267267

268268
### Tree
@@ -271,7 +271,7 @@ A tree has hierarchical data and it has nodes. It is a type of graph. Each node
271271
A tree is `acyclic` meaning it has no cycles: "a cycle is a path [AKA sequence] of edges and vertices wherein a vertex is reachable from itself".
272272
Therefore, a tree is also called as `Directed Acyclic Graph (DAG)`.
273273

274-
![](https://i.imgur.com/wUiUy0B.png)
274+
![ ](https://i.imgur.com/wUiUy0B.png)
275275

276276
- **Root**: top node of tree is called root and has no parent and has no incoming edges.
277277
- **Node**: every node has parent ( except root ) and 0 or more children's.
@@ -284,9 +284,9 @@ Therefore, a tree is also called as `Directed Acyclic Graph (DAG)`.
284284
- **Parent**: Node is a parent of all the child nodes that are linked by outgoing edges. - **Sibling**: Nodes in the tree that are children of the same parent are called siblings.
285285
- **Ancestor**:  A node reachable by repeated moving from child to parent.
286286

287-
![](https://imgur.com/L04E7lo.png)
287+
![ ](https://imgur.com/L04E7lo.png)
288288

289-
![](https://i.imgur.com/Jzwpguk.png)
289+
![ ](https://i.imgur.com/Jzwpguk.png)
290290

291291
If you want to store hierarchical data use Tree.
292292

@@ -296,7 +296,7 @@ You should know about `Binary Tree` and `Binary Search Tree`.
296296

297297
In BFS algorithm, a graph is traversed in layer-by-layer fashion. point. The queue is used to implement BFS.
298298

299-
![](https://i.imgur.com/i7nf4go.png)
299+
![ ](https://i.imgur.com/i7nf4go.png)
300300

301301
Example: Suppose you have given a tree structure and asked to calculate the average of numbers at each level.
302302

@@ -305,7 +305,7 @@ Example: Suppose you have given a tree structure and asked to calculate the aver
305305
- **Space Complexity**: `O(n logn)`
306306
- Use `Queue` while coding.
307307

308-
![](https://i.imgur.com/DdFyXGx.png)
308+
![ ](https://i.imgur.com/DdFyXGx.png)
309309

310310
- [Breadth-first Traversal Question](https://codepen.io/roopkt/pen/bGqjVZe?editors=0010)
311311
- [Breadth-first Traversal Answer](https://codepen.io/roopkt/pen/XWMBdWv?editors=0010)
@@ -314,14 +314,14 @@ Example: Suppose you have given a tree structure and asked to calculate the aver
314314

315315
The DFS algorithm we start from starting point and go into depth of graph until we reach a dead end and then move up to parent node (Backtrack). The stack is used to implement DFS.
316316

317-
![](https://i.imgur.com/4P7FMDl.png)
317+
![ ](https://i.imgur.com/4P7FMDl.png)
318318

319319
- **Strategy**: `Recursive`
320320
- **Time Complexity**: `O(n logn)`
321321
- **Space Complexity**: `O(n logn)`
322322
- Use `Recursive Call Stack` while coding.
323323

324-
![](https://i.imgur.com/DdFyXGx.png)
324+
![ ](https://i.imgur.com/DdFyXGx.png)
325325

326326
- [Breadth-first Traversal Question](https://codepen.io/roopkt/pen/bGqjVZe?editors=0010)
327327
- [Breadth-first Traversal Answer](https://codepen.io/roopkt/pen/XWMBdWv?editors=0010)
@@ -340,7 +340,7 @@ The DFS algorithm we start from starting point and go into depth of graph until
340340

341341
A binary tree is a type of tree in which each node has `at most two children` (0, 1 or 2) which are referred as left child and right child.
342342

343-
![](https://i.imgur.com/fkRP5Ju.png)
343+
![ ](https://i.imgur.com/fkRP5Ju.png)
344344

345345
#### Binary Search Tree (BST)
346346

@@ -349,15 +349,15 @@ In Binary Search Tree nodes are:
349349
- The key in the left subtree is less than the key in its parent node.
350350
- The key in the right subtree is greater or equal the key in its parent node.
351351

352-
![](https://i.imgur.com/u5WpbHe.png)
352+
![ ](https://i.imgur.com/u5WpbHe.png)
353353

354354
[Checkout Binary Search Tree Visualization here.](https://www.cs.usfca.edu/~galles/visualization/BST.html)
355355

356356
BSTs get an average case of `O(log n)` on gets, adds, and deletes, but they can have a worst case of `O(n)` if you do something like add a sorted list to a BST. Go ahead, do a BST then add [1,2,3,4,5] to it.
357357

358358
Below image showing how to add `[3, 7, 4, 6, 5, 1, 10, 2, 9, 8]` in BST.
359359

360-
![](https://i.imgur.com/qkefQzD.png)
360+
![ ](https://i.imgur.com/qkefQzD.png)
361361

362362
- [Binary Search Tree Implementation Question](https://codepen.io/roopkt/pen/RwpJBOw?editors=0010)
363363
- [Binary Search Tree Implementation Answer](https://codepen.io/roopkt/pen/LYWBYMM?editors=0010)
@@ -366,15 +366,15 @@ Below image showing how to add `[3, 7, 4, 6, 5, 1, 10, 2, 9, 8]` in BST.
366366

367367
Trie is a tree, in which we store only one character at each node. This final key value pair is stored in the leaves.
368368

369-
![](https://i.imgur.com/o9UWgEN.png)
369+
![ ](https://i.imgur.com/o9UWgEN.png)
370370

371371
Trie is also suitable for solving partial match and range query problems.
372372

373373
### Heap ( Priority Queue )
374374

375375
Each node in the heap follows the rule that the `parent value is greater than its two children` are.
376376

377-
![](https://i.imgur.com/J5If65C.png)
377+
![ ](https://i.imgur.com/J5If65C.png)
378378

379379
There are two types of the heap data structure:
380380

@@ -389,13 +389,13 @@ It is just like a dictionary or key value pair.
389389

390390
### Graph
391391

392-
![](https://i.imgur.com/kYlxMWJ.png)
392+
![ ](https://i.imgur.com/kYlxMWJ.png)
393393

394394
Graph represents network. It has Nodes, Vertices and Edges.
395395

396396
#### Implement Graph
397397

398-
![](https://i.imgur.com/eqzKDIV.png)
398+
![ ](https://i.imgur.com/eqzKDIV.png)
399399

400400
[Question](https://codepen.io/roopkt/pen/ZEejLJe?editors=0010)
401401
[Answer](https://codepen.io/roopkt/pen/vYxagrP?editors=0010)
@@ -405,17 +405,17 @@ Graph represents network. It has Nodes, Vertices and Edges.
405405
When you want to find all possible routes between airports then you want to use BFS.
406406
Find all possible routes from `PHX` to `BKK`. Also then you can decide which path is the shortest one.
407407

408-
![](https://i.imgur.com/Fc8HIae.png)
408+
![ ](https://i.imgur.com/Fc8HIae.png)
409409

410410
[Question Answer Source Code: Find all possible routes using BFS](./src/data-structure/5-graph/breadth-first-search.mjs)
411411

412-
![](https://i.imgur.com/CvPhRQx.png)
412+
![ ](https://i.imgur.com/CvPhRQx.png)
413413

414-
![]((https://i.imgur.com/DrWF78t.png)
414+
![ ]((https://i.imgur.com/DrWF78t.png)
415415

416416
#### Depth First Search (DFS)
417417

418-
![](https://i.imgur.com/wHevaTK.png)
418+
![ ](https://i.imgur.com/wHevaTK.png)
419419

420420
[Question Answer Source Code: Find shortest path using DFS](./src/data-structure/5-graph/depth-first-search.mjs)
421421

@@ -427,7 +427,7 @@ Browser's JavaScript Engine (`Array.prototype.sort`) uses merge sort maximum tim
427427

428428
https://www.youtube.com/watch?v=UxnyImctVzg
429429

430-
![](https://i.imgur.com/YpQSB5J.png)
430+
![ ](https://i.imgur.com/YpQSB5J.png)
431431

432432
#### Merge Sort Implementation
433433

@@ -442,7 +442,7 @@ Merge Sort Implementation Visualization:
442442

443443
2 sorted arrays find the median element. Median is the middle index its not an average of values in an sorted array.
444444

445-
![](https://i.imgur.com/anPm3Yx.png)
445+
![ ](https://i.imgur.com/anPm3Yx.png)
446446

447447
So in order to find median we can use the stich algorithm since arrays are already sorted. Then we can find the middle index.
448448

@@ -452,7 +452,7 @@ So in order to find median we can use the stich algorithm since arrays are alrea
452452

453453
When Browser's are not using Merge sort they most of the time use Quick sort variations.
454454

455-
![](https://i.imgur.com/LudZhvH.png)
455+
![ ](https://i.imgur.com/LudZhvH.png)
456456

457457
#### Quick Sort Implementation
458458

@@ -471,7 +471,7 @@ Divide two integers without using '/' (division) or '\*' (multiplication) operat
471471
node .\src\math-and-stats\integer-division.js
472472
```
473473

474-
![](https://imgur.com/Cf7cz4W.png)
474+
![ ](https://imgur.com/Cf7cz4W.png)
475475

476476
### Array slice
477477

@@ -485,7 +485,7 @@ Slice does not mutate the original array.
485485
[20,39,48,58,16,36,48].slice(3,7) = [58,16,36,48]
486486
```
487487

488-
![](https://i.imgur.com/9iaew6W.png)
488+
![ ](https://i.imgur.com/9iaew6W.png)
489489

490490
### Math.floor
491491

@@ -507,7 +507,7 @@ Math.round(2.4) = 2
507507

508508
### Get the Average value at each level of the tree
509509

510-
![](https://imgur.com/N6agnSk.png)
510+
![ ](https://imgur.com/N6agnSk.png)
511511

512512
Traverse by depth and collect all the numbers.
513513
And calculate average also.

0 commit comments

Comments
 (0)