Skip to content

Commit 48e8c09

Browse files
committed
chore: greedy
1 parent b32e09f commit 48e8c09

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

‎README.md

+17-4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
- [How many zeros in 1 Million](#how-many-zeros-in-1-million)
5757
- [Integer Division Without Using \* or /](#integer-division-without-using--or-)
5858
- [JavaScript Fundamentals](#javascript-fundamentals)
59+
- [Initialize 2D Array 4x4 with 0](#initialize-2d-array-4x4-with-0)
5960
- [JavaScript Map](#javascript-map)
6061
- [Array Sort](#array-sort)
6162
- [Array Sort](#array-sort-1)
@@ -688,6 +689,16 @@ node .\src\math-and-stats\integer-division.js
688689

689690
## JavaScript Fundamentals
690691

692+
693+
### Initialize 2D Array 4x4 with 0
694+
695+
```js
696+
const x = new Array(4).fill( new Array(4).fill(0))
697+
```
698+
699+
![](https://i.imgur.com/JXVJGgJ.png)
700+
701+
691702
### JavaScript Map
692703

693704
```js
@@ -1265,17 +1276,19 @@ Note: Greedy Algorithms may not work always like Longest Path in Binary Tree.
12651276

12661277
### Where Greedy Algorithms can be used?
12671278

1268-
Below are the standard problems solved by Greedy Algorithms.
1279+
Below are the standard problems solved by Greedy Algorithms. I have solved first 4 problems listed below:
1280+
1281+
https://codepen.io/collection/QWbzGB
12691282

12701283
- Activity Selection
12711284
- Fractional Knapsack
1285+
- DIEHARD
1286+
- DEFKIN
12721287
- Job Sequencing
1288+
- Huffman Coding
12731289
- Prim's Algorithm
12741290
- Kruskal's algorithm
12751291
- Dijkstra's algorithm
1276-
- Huffman Coding
1277-
- DIEHARD
1278-
- DEFKIN
12791292
- Finding close to optimal solutions for `NP Hard Problem` like `Travelling Salesman Problem`
12801293

12811294
### Huffman Coding

0 commit comments

Comments
 (0)