Question: please complete the following programming problem using Ocaml (* Define a recursive function, decToBin (n : int) : bool list, that returns the little-endian binary
please complete the following programming problem using Ocaml
(* Define a recursive function, decToBin (n : int) : bool list, that returns the little-endian binary encoding, as a list of boolean values, of the positive integer n. For example, decToBin 1 = [true] decToBin 2 = [false; true] decToBin 3 = [true; true] decToBin 23 = [true; true; true; false; true] *)
(* precondition: n > 0 *) let rec decToBin (n : int) : bool list = (* FILL IN HERE *) ;;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
