Answer:
Follows are the solution to this question:
Step-by-step explanation:
please find the complete question in the attached file.
The Pseudocode for Non-Recursive:
In step 1: After completing the Iterations i, the N(i) represent the number of squares.
In step 2: Its pattern of diagonally spaced squares could be found, with alternating lengths.
In step 3: It has runs of the square of length i and i − 1 run of loops of length i − 1. The equation follows:
[tex]N(i) = i 2 + (i -1)2 = 2i \ 2 - 2i + 1.[/tex]
The Pseudocode for the Recursive:
It takes the very same steps and regards it as step 3 instead of step 3 In step 3:
Using the [tex]N(i) = N(i -1) + 4i - 4[/tex] incidence connection where approximation i square is generated by adding squares arranged in a diamond shape on the other side i. The diamond of length equal to i which consists of 4i − 4 squares.