Dynamic memory management


Q1.

a) Given an array A(1:n) of n elements. Propose a scheme to divide it into n equivalent parts apart from possibly the last. Each part will be treated as the stack. State all the boundary conditions. Write down the functions to pop and push any element over any of the general stack. No overlapping is permitted in the adjacent stacks even if the neighboring stack is empty.

b) Describe the Buddy systems.

c) Supposing that the priority queue is implemented by using the linked lists where a master list includes a pointer to the corresponding priority list. Write down a function to insert an element x of priority p to this queue.

Q2.

a) Describe firstfit and bestfit approaches of the dynamic memory management.

b) Prove that the linked binary tree with n ≥ 0 nodes encompasses exactly n+1 NULL links.

c) Write down the code for in-order traversal of the right-threaded binary search tree.

Request for Solution File

Ask an Expert for Answer!!
Data Structure & Algorithms: Dynamic memory management
Reference No:- TGS010246

Expected delivery within 24 Hours