Advanced C
2 exercises · in teaching order
- 1Fibonacci without recursionWrite `long fib(int n)` with `fib(0)=0`, `fib(1)=1`, iteratively - two variables, no recursion.iterationoverflow awareness12m
- 2Binary searchWrite `long bsearch_idx(const int *a, int n, int target)` returning the index of `target` in the sorted array, or `-1` if absent.divide and conqueroff-by-one discipline14m