File tree 1 file changed +17
-4
lines changed
1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 56
56
- [ How many zeros in 1 Million] ( #how-many-zeros-in-1-million )
57
57
- [ Integer Division Without Using \* or /] ( #integer-division-without-using--or- )
58
58
- [ JavaScript Fundamentals] ( #javascript-fundamentals )
59
+ - [ Initialize 2D Array 4x4 with 0] ( #initialize-2d-array-4x4-with-0 )
59
60
- [ JavaScript Map] ( #javascript-map )
60
61
- [ Array Sort] ( #array-sort )
61
62
- [ Array Sort] ( #array-sort-1 )
@@ -688,6 +689,16 @@ node .\src\math-and-stats\integer-division.js
688
689
689
690
## JavaScript Fundamentals
690
691
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
+
691
702
### JavaScript Map
692
703
693
704
``` js
@@ -1265,17 +1276,19 @@ Note: Greedy Algorithms may not work always like Longest Path in Binary Tree.
1265
1276
1266
1277
### Where Greedy Algorithms can be used?
1267
1278
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
1269
1282
1270
1283
- Activity Selection
1271
1284
- Fractional Knapsack
1285
+ - DIEHARD
1286
+ - DEFKIN
1272
1287
- Job Sequencing
1288
+ - Huffman Coding
1273
1289
- Prim's Algorithm
1274
1290
- Kruskal's algorithm
1275
1291
- Dijkstra's algorithm
1276
- - Huffman Coding
1277
- - DIEHARD
1278
- - DEFKIN
1279
1292
- Finding close to optimal solutions for ` NP Hard Problem ` like ` Travelling Salesman Problem `
1280
1293
1281
1294
### Huffman Coding
You can’t perform that action at this time.
0 commit comments