We don't do your homework, you're not showing any work you've done, and you haven't told us exactly what's wrong, i.e. compilation errors, algorithm not producing correct results, etc. We give help, not code.
Visual Representation of Best Fit Algorithm - http://www.youtube.com/watch?v=QSXB693Hrls
First Fit is pretty self-explanatory. The process will be allocated to the first memory location that can hold it.
For both, you're going to iterate over your memory list. For Best Fit, you must search the entire list, while First Fit will stop once it reaches a memory location that can hold it. In Best Fit, you'll have a variable that will update as you search, storing the best location that fits the process the best.