Answer:
attached below is the solution
Explanation:
hello attached below is the sequence of push and pop operations on stack memory
For The collatz method below
public void collatz(int n) {
if (n == 1) return;
else if (n % 2 == 0)
collatz(n / 2);
else collatz(3*n + 1); }