I made a project in C to find solution for allocation problem in dynamic storage.
I used best-fit concept, then I made a best fit algorithm in this project.
Best-fit is allocating the smallest hole that is big enough; must search entire list, unless ordered by size then produces the smallest leftover hole.
Best-fit better than worst-fit in terms of speed and storage utilization.
You can see the project with given inputs and best-fit algorithm with proper comments.
I hope, you will understand it easily.
You will see all process to show their fit to which blocks in order then remaining size of blocks in order on the output.