Skip to content

Commit 6b0a556

Browse files
committed
chore: organize
1 parent 2a344ec commit 6b0a556

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

README.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
- [Queue](#queue)
2828
- [Enqueue an element in Queue](#enqueue-an-element-in-queue)
2929
- [Dequeue an element from Queue](#dequeue-an-element-from-queue)
30-
- [Tree](#tree)
31-
- [Breadth-first Traversal](#breadth-first-traversal)
32-
- [Depth-first Traversal](#depth-first-traversal)
33-
- [DFS Vs BFS](#dfs-vs-bfs)
34-
- [Binary Tree](#binary-tree)
35-
- [Binary Search Tree (BST)](#binary-search-tree-bst)
36-
- [Trie](#trie)
37-
- [Heap ( Priority Queue )](#heap--priority-queue-)
38-
- [Hash-Table](#hash-table)
39-
- [Graph](#graph)
30+
- [Tree](#tree)
31+
- [Breadth-first Traversal](#breadth-first-traversal)
32+
- [Depth-first Traversal](#depth-first-traversal)
33+
- [DFS Vs BFS](#dfs-vs-bfs)
34+
- [Binary Tree](#binary-tree)
35+
- [Binary Search Tree (BST)](#binary-search-tree-bst)
36+
- [Trie](#trie)
37+
- [Heap ( Priority Queue )](#heap--priority-queue-)
38+
- [Hash-Table](#hash-table)
39+
- [Graph](#graph)
4040
- [Algorithms Q&A](#algorithms-qa)
4141
- [Merge Sort](#merge-sort)
4242
- [Merge Sort Implementation](#merge-sort-implementation)
@@ -262,7 +262,7 @@ queue.shift(); // 3 , queue [4]
262262
queue.shift(); // 4 , queue []
263263
```
264264

265-
## Tree
265+
### Tree
266266

267267
A tree has hierarchical data and it has nodes.
268268

@@ -287,7 +287,7 @@ If you want to store hierarchical data use Tree.
287287

288288
You should know about `Binary Tree` and `Binary Search Tree`.
289289

290-
### Breadth-first Traversal
290+
#### Breadth-first Traversal
291291

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

@@ -304,7 +304,7 @@ Example: Suppose you have given a tree structure and asked to calculate the aver
304304
- [Breadth-first Traversal Exercise](https://codepen.io/roopkt/pen/bGqjVZe?editors=0010)
305305
- [Breadth-first Traversal Answer](https://codepen.io/roopkt/pen/XWMBdWv?editors=0010)
306306

307-
### Depth-first Traversal
307+
#### Depth-first Traversal
308308

309309
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.
310310

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

322-
### DFS Vs BFS
322+
#### DFS Vs BFS
323323

324324
| DFS | BFS |
325325
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
@@ -329,13 +329,13 @@ The DFS algorithm we start from starting point and go into depth of graph until
329329
| 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. |
330330
| Time Complexity: O(V+E) | Time Complexity: O(V+E) |
331331

332-
## Binary Tree
332+
### Binary Tree
333333

334334
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.
335335

336336
![](https://i.imgur.com/fkRP5Ju.png)
337337

338-
### Binary Search Tree (BST)
338+
#### Binary Search Tree (BST)
339339

340340
In Binary Search Tree nodes are:
341341

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

358-
## Trie
358+
### Trie
359359

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

362362
![](https://i.imgur.com/o9UWgEN.png)
363363

364364
Trie is also suitable for solving partial match and range query problems.
365365

366-
## Heap ( Priority Queue )
366+
### Heap ( Priority Queue )
367367

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

@@ -376,11 +376,11 @@ There are two types of the heap data structure:
376376

377377
A heap is a useful data structure when you want to get max/min one by one from data.
378378

379-
## Hash-Table
379+
### Hash-Table
380380

381381
It is just like a dictionary or key value pair.
382382

383-
## Graph
383+
### Graph
384384

385385
![](https://i.imgur.com/kYlxMWJ.png)
386386

0 commit comments

Comments
 (0)