C Code For Best Fit Algorithm