There is a lack of a diagram to go along with this question...
For a circle its Pier Squared
Answer:
F# Code:
let rec prefix n list =
//Extracting head and tail elements
let valHead = (Listhead list)
let valTail = (Listtail list)
// Checking n value
match n with
| 0 -> []
| _ -> [valHead] at (prefix (n-1) valTail) // Creating list recursively
//Testing function
let lstT = [1; 2; 3; 4; 5]
printfn "%A" (prefix 3 lstT)
printfn "%A" (prefix 2 lstT)
printfn "%A" (prefix 4 lstT)
Step-by-step explanation: see attachment below for sample run
Answer:
625
Step-by-step explanation:
5 times 5 is 25. 25 times 5 is 125. 125 times 5 is 625. Notice how I multiplied 5 repeatedly 4 times.