Write a program that simulates the heap

Assignment Help Data Structure & Algorithms
Reference no: EM132106340

this program is in C++

please use pointers and -> . and also please it should be a working program

Question: Write a program that simulates the "heap" using a linked list. This program should start off by taking one node of size 9096 KB. You can assume that all request to the heap are in KB.

The user should request a size of memory from the system, then the system should find memory that can be allocated based on the user's request.

If memory cannot be allocated based on user's request, send the appropriate message. Memory should be returned back to teh system after it is freed. Things to remember, you should write a user interface that has menu commands to request memory, free memory and display used memory.

Sample Memory request adn heap after request.

Heap: Node 1: Start Address: 0 Size: 9096 KB Used Memory: NULL User Request: 10 User Request: 20 User Request: 50 User Request: 10 Heap: Node 1: Start Address: 80 Size: 9006 KB Used memory: Node 1: Start Address: 0 Size 10 KB Used memory: Node 2: Start Address: 10 Size 20 KB Used memory: Node 3: Start Address: 30 Size 50 KB Used memory: Node 4: Start Address: 80 Size 10 KB Free Memory Start Address: 10 Heap Node 1: Start Address: 10 Size : 20 KB Heap Node 2: Start Address 80: Size 9006 KB Used memory: Node 1: Start Address: 0 Size 10 KB Used memory: Node 2: Start Address: 30 Size 50 KB Used memory: Node 3: Start Address: 80 Size 10 KB Free Memory Start Address: 30 Heap Node 1: Start Address: 10 Size : 70 KB Heap Node 2: Start Address 80: Size 9006 KB Used memory: Node 1: Start Address: 0 Size 10 KB Used memory: Node 2: Start Address: 80 Size 10 KB

Reference no: EM132106340

Questions Cloud

Extreme moodiness fluctuating between depression : Nick is an adolescent boy who has been very difficult for his parents. He experiences extreme moodiness fluctuating between depression and intense feeling
Does having a mental problem and being addicted : Does having a mental problem and being addicted make you a higher relapse risk?
If faced with a values conflict with a client : If faced with a values conflict with a client, how would you go about trying to resolve it? and which conflicting values might you find most difficult
Chemical dependency counselor : What values would be important to have as a human service worker or chemical dependency counselor? and why?
Write a program that simulates the heap : The user should request a size of memory from the system, then the system should find memory that can be allocated based on the user's request.
How to the operating systems schedule all the processes : How to the Operating Systems schedule all the processes on a multiprocessor or multicore environment.
Accompanied with a sense of intensity : Enlightenment is accompanied with a sense of intensity, a feeling of clarity, a sense of unity, and a feeling of surrender.
What would be the actual cpi : If the program is executed on the MIPS pipeline, what would be the actual CPI? And without forwarding, what would be the actual CPI?
Helping someone who has suffered a loss : What do you see as being most important in helping someone who has suffered a loss, needing another perspective please?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd