I am new to recursion and my teacher gave us this code to examine:

```
public long rudolph(long a, long b){
 if(b==0)
   return a;
 else 
   return rudolph(b, a % b);
}

```

I tried to follow the logic by using different values for a and b each time but I can't make sense of the outcomes. How to figure this out without running it? Basically trying to figure out what this code does in general.

example:

```
if a = 9 and b = 7:
return rudolph(7,2);
return rudolph(2,1);
return rudolph(1,0);
return 1

if a = 10 and b = 5:
return rudolph(5,0);
return 5

if a = 5 and b = 2:
return rudolph(2,1);
return rudolph(1,0);
return 1

```