Write a program in C++ (6.0 or .net) to determine the bitmap for a memory having 32 frames (f..f31) using the Buddy algorithm shown in class. You may use any data structures to implement the program.
The following shows the functions to be implemented in your program.
(1) a(n,f), where a = allocate, n = number of frames allocated (1..9), and f = the startingframe number (0..31)
e.g. a(3,10) will allocate 3 frames starting from f10 (*i.e.* f10, f11, and f12 are allocated).
(2) d(n,f), where d = deallocate, n = number of frames deallocated (1..9), and f = the starting frame number (0..31)
e.g. d(2,19) will deallocate 2 frames starting from f19 (*i.e.* f19 and f20 are deallocated).
(3) s, used to show the bitmap for all the possible group sizes (*i.e.* 1, 2, 4, 8, 16).
(4) q, used to stop the program
The following shows a scenario of running the program, where user’s inputs are in **boldface**.
>**smi3456p2** {an executable program}
program starts running……
please enter a command:**a(5,3)
** please enter a command:**a(3,11)
**please enter a command:**a(7,22)
**
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
windows ,c++
please enter a command:**s
**size 1: 0100010000000010
size 2: 10110101
size 4: 0010
size 8: 00
size 16: 0
please enter a command:**d(2,5)
**please enter a command:**d(3,25)
**please enter a command:**d(3,11)
**please enter a command:**s
**size 1: 0111000000001010
size 2: 10000111
size 4: 0010
size 8: 10
size 16: 0
please enter a command:**q**