Question: In this project, you are required to implement a set of min - heap operations in ARM assembly language. You will use KEIL simulator to
In this project, you are required to implement a set of minheap operations in ARM assembly
language. You will use KEIL simulator to develop and test your code.
First of all, you will implement the minheap data structure which has the logical structure of a
nearly complete binary tree as an array of bit integers. The first element in the array A is the
size of the heap, ie the number of elements in the heap ie the integer size is in A The rest
of the elements in A A to Asize are the values in the nodes of the binary tree.
Fundamental property of a minheap is that for every node i other than the root, Aparenti Ai
that is the value of a node is at most the value of its parent. If a node is at the kth location in the
array, its children will be at the k and thek locations of the array. The following figures gives
three different minheaps which have and nodes.
Figure : Three sample minheaps with a nodes, b nodes and c nodes.
Procedures of the Project
I. build list heap
This procedure constructs a minheap data structure from a list of integers. The values of the
integers in the list are in no particular order, but they are located in successive memory locations,
from first to last. The address of the first integer is in the list argument given in R; and assume
that the list is terminated by a special value, MAXINT, the negative integer with
the largest possible absolute value. The address of the place where the procedure should create
the data structure is in heap argument given in R
II find value heap
This procedure finds a particular value given in R register in the minheap, where the address of
the first item of the data structure is in heap argument given in R The search result should be
stored in R register. If the item is found R otherwise R If the value is found in the heap,
R should contain its address. For this procedure, the original data structure heap should be
unmodified.
III. sort size heap
This procedure sorts the elements using the heap structure. Procedure takes two arguments: size
of array given in R register and the address of the first item of the data structure is in heap
argument given in R End of the operation the address of the first element of sorted list should
be in R register.Figure a
Figure b
Figure c
Figure : Three sample minheaps with a nodes, b nodes and c nodes.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
