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
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.
310
310
@@ -319,7 +319,7 @@ The DFS algorithm we start from starting point and go into depth of graph until
@@ -329,13 +329,13 @@ The DFS algorithm we start from starting point and go into depth of graph until
329
329
| 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. |
330
330
| Time Complexity: O(V+E) | Time Complexity: O(V+E) |
331
331
332
-
## Binary Tree
332
+
###Binary Tree
333
333
334
334
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.
335
335
336
336

337
337
338
-
### Binary Search Tree (BST)
338
+
####Binary Search Tree (BST)
339
339
340
340
In Binary Search Tree nodes are:
341
341
@@ -355,15 +355,15 @@ Below image showing how to add `[3, 7, 4, 6, 5, 1, 10, 2, 9, 8]` in BST.
355
355
-[Binary Search Tree Implementation Exercise](https://codepen.io/roopkt/pen/RwpJBOw?editors=0010)
356
356
-[Binary Search Tree Implementation Answer](https://codepen.io/roopkt/pen/LYWBYMM?editors=0010)
357
357
358
-
## Trie
358
+
###Trie
359
359
360
360
Trie is a tree, in which we store only one character at each node. This final key value pair is stored in the leaves.
361
361
362
362

363
363
364
364
Trie is also suitable for solving partial match and range query problems.
365
365
366
-
## Heap ( Priority Queue )
366
+
###Heap ( Priority Queue )
367
367
368
368
Each node in the heap follows the rule that the `parent value is greater than its two children` are.
369
369
@@ -376,11 +376,11 @@ There are two types of the heap data structure:
376
376
377
377
A heap is a useful data structure when you want to get max/min one by one from data.
0 commit comments