
Episode 102: Rust scan (vs C++ & Haskell scans)
ADSP: Algorithms + Data Structures = Programs
00:00
Haskell
In the Rust version, this is equivalent to a scan L. It requests both a binary operation and an initial value. But it doesn't give you back N plus one elements. So we're doing a scan L with a plus operation, zero identity element over the numbers one, two, three, and you get back zero, one, three, six. And now we're going to change this to call scan L one, and we remove the initial value. We are going to switch temporarily to Haskell. One that takes a binary operations and initial value, both take sequences. The other one just takes a binary operation, no initial value. Whereas of the output is the initialvalue.
Play episode from 08:30
Transcript


