-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapreduce.tex
More file actions
22 lines (8 loc) · 1.03 KB
/
mapreduce.tex
File metadata and controls
22 lines (8 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
\chapter{Map Reduce}
\section{Map}
The \texttt{map()} operation\footnote{It is mildly confusing that there is a \texttt{map} data structure and a \texttt{map()} operation, so I will be marking the \texttt{map()} operation with a function invocation.} is a powerful function that may require us to think differently about the way we have approached programming so far.
The map operation takes in 2 arguments, a collection and a function to apply to every item in the collection
When we are writing functions , we are creating new verbs for our programming language to use . These verbs take in arguments, nouns that we may have declared or defined ourselves. But one thing that we May not have done yet is passing a function as an argument to another function.
This is not an uncommon operation in mathematics Example listed below
The semantics of this in every programming language is different , but the concept is the same
Why introduces here? Because a lot of common operations that can be done with map reduce involve using hash tables