Question: Implement prefix sum in OCaml, psum : int list int list. The prefix sum algorithm takes a sequence of numbers x 0 , x 1
Implement prefix sum in OCaml, psum : int list int list. The prefix sum algorithm takes a sequence of numbers x x x as input and returns a sequence of numbers y y y such that y x y x x y x x x and so on Examples: # psum ; ; ; ;; : int list ; ; ; ;; # psum ; ; ; ;; : int list ; ; ; # psum ;; : int list Note: You are not allowed to use OCamls imperative features.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
