Cilk parallel programming exercise -- Due March 13

The reading for this exercise is Cilk manual Chapters 2 and 3 (except 2.3, 2.4, 2.5)
http://supertech.lcs.mit.edu/cilk/.

Draw a dag(directed acyclic graph) for the following program. Specify lo and hi values for each node.

How many threads (except main thread) are spawned in the program? Formulate number of threads with respect to N.

......
......
#define N 9
......
......

void merge(int A[], int lo, int split, int hi) 
{
  /* Merges the two halves into a temporary array, then copies
     the sorted elements back into the original array. */
  ...
}

cilk void merge_sort(int A[], int lo, int hi) 
{
  /* sorts each half of the array recursively. */
  
  int mid;
  
  if (lo < hi) 
    {
      split = (lo + hi)/2;
      spawn merge_sort(A, lo, mid);
      spawn merge_sort(A, mid + 1, hi);
      sync;
      merge(A, lo, mid, hi);
    }
  return;
}

cilk int main(int argc, char *argv[])
{
   int A[N];

   fill_array(A); // fills the array with random numbers
   spawn merge_sort(A, 0, N-1);
   sync;
   print_array(A); // prints array
   return 0;
}