linux-sysprog · beginner · ~15 min
Reason about exponential process growth.
If every existing process calls fork() once at each of n rounds, the process count doubles each round. Implement long processes_after(int n) returning the total after n rounds (starting from 1).
long processes_after(int n) {
/* TODO */
return 1;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.