Link
:::info
lf : last level
lg of node in same level is equal to lg of leftmost node with floor
:::
void minheap_init(unsigned long nr_items, struct heap_item *h)
{
unsigned long lf = log2_floor(nr_items);
Jim Huang changed 3 years agoView mode Like Bookmark
Role of mutex in Fibonacci driver
gist
There are no shared resources in algorithm of calculating Fibonacci sequence itself, hence no critical section are present in the algorithm.
Shared resources are needed when we wish to store "Computed result" to not waste CPU cycle on recomputing the values.
There are repeating computation without dynamic programming, For an example, Fib(1) are called twice.
We can calculate Fibonacci sequence bottom-up by storing result their result in an array.