What scenarios would warrant the use of the "Map and Reduce" algorithm?
Is there a .NET implementation of this algorithm?
Linq equivalents of Map and Reduce: If you’re lucky enough to have linq then you don’t need to write your own map and reduce functions. C# 3.5 and Linq already has it albeit under different names.
Map is Select:
Select
Enumerable.Range(1, 10).Select(x => x + 2);
Reduce is Aggregate:
Aggregate
Enumerable.Range(1, 10).Aggregate(0, (acc, x) => acc + x);
Filter is Where:
Where
Enumerable.Range(1, 10).Where(x => x % 2 == 0);
https://www.justinshield.com/2011/06/mapreduce-in-c/
1.4m articles
1.4m replys
5 comments
57.0k users