In C please Objective: To simulate memory allocation with hole-fitting algorithms (First-fit, Best-fit) and implement de

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

In C please Objective: To simulate memory allocation with hole-fitting algorithms (First-fit, Best-fit) and implement de

Post by answerhappygod »

In C please
Objective:
To simulate memory allocation with hole-fitting algorithms
(First-fit, Best-fit) and implement deallocation and
defragmentation of memory blocks.
Specification:
The program simulates memory allocation with a chosen
hole-fitting algorithm (First-fit, Best-fit) and implements
deallocation and defragmentation. A menu controls the operations,
and each choice calls the appropriate procedure, where the choices
are:
In C Please Objective To Simulate Memory Allocation With Hole Fitting Algorithms First Fit Best Fit And Implement De 1
In C Please Objective To Simulate Memory Allocation With Hole Fitting Algorithms First Fit Best Fit And Implement De 1 (361.53 KiB) Viewed 69 times
Sample output Memory allocation 1) Enter parameters 2) Allocate memory for block 3) Deallocate memory for block 4) Defragment memory 5) Quit program Enter selection: 1 Enter size of physical memory: 1024 Enter hole-fitting algorithm (0=first fit, l=best_fit): 1 Memory allocation 1) Enter parameters 2) Allocate memory for block 3) Deallocate memory for block 4) Defragment memory 5) Quit program Enter selection: 2 Enter block id: 0 Enter block size: 128 ID Start End 0 0 128 Memory allocation 1) Enter parameters 2) Allocate memory for block 3) Deallocate memory for block 4) Defragment memory 5) Quit program Enter selection: 2 Enter block id: 1 Enter block size: 320 ID Start End 0 1 0 128 128 448 Memory allocation 1) Enter parameters 2) Allocate memory for block 3) Deallocate memory for block 4) Defragment memory 5) Quit program Enter selection: 2 Enter block id: 2 Enter block size: 224 ID Start End 0 1 2 0 128 448 128 448 672 Memory allocation 1) Enter parameters 2) Allocate memory for block 3) Deallocate memory for block 4) Defragment memory 5) Quit program Enter selection: 2 Enter block id: 3 Enter block size: 288
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply