Date: Wednesday, March 1, 2023.
Due Date:Wednesday, March 8, 2023.
Convert the following tail recursive function to iterative:
int sequence1(int n) { if (n < 5) return n; else if (n % 2 == 0) return sequence1(n/2); else return sequence1((n-1)/2); }
Convert the following recursive function to tail recursive:
int sequence2(int n) { if (n < 4) return n/2; else return 3 * sequence2(n-1);
Upload to Canvas, Assignments, Class Exercise 2, a file containing the solution, or just the text of the solution as the submission entry. Add a comment mentioning all the people in the team. One submission per team is sufficient.