Answer:
Follows are the solution to this question:
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:
![N(i) = i 2 + (i -1)2 = 2i \ 2 - 2i + 1.](https://img.qammunity.org/2021/formulas/mathematics/college/a3fitzhrj9p6adbf3hb963sgfpm9a0zo94.png)
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
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.