The program contains two parts which are for the first-fit algorithm and best-fit algorithm. For the first-fit algorithm, the number of jobs and memory blocks are taken from the text files which are jobList.txt and memoryList.txt. Both of the text files contain all the data about the jobs such as arrival time, process time, job number and job size and also the data about the memory blocks which is memory block number and memory sizes. The size of each memory block and jobs are stored in an array to allocate the process using first-fit algorithm. To allocate the processes, the constraints which is block size is greater than or equal to process size must meet the size to allocate the job into the memory that fit. If it does not meet the memory block size, the job is move to the next memory block and the block is checked. The process is continuing until all the jobs are checked and will be display if the job is allocated to a respective memory block and the process pauses when the event happens and it will continue when any key is hit on the keyboard. The best-fit algorithm deals with the division of the smallest free partition that satisfies the criteria of the application process. This algorithm first scans the whole list of free partitions and finds the smallest hole to be suitable. It then attempts to find a hole that is similar to the actual process size required.
-
Notifications
You must be signed in to change notification settings - Fork 0
anisafqh/Algorithms
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
The project program first-fit algorithm and best-fit algorithm using C++
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published