{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Report

# Report - EE113D Professor Rajeev Jain TA Rick Lan Project...

This preview shows pages 1–4. Sign up to view the full content.

EE113D Professor: Rajeev Jain TA: Rick Lan Project Report: Heap Sort Group Members: Shuofei Geng Michael Utanes Felix Lu

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Introduction: Our project revolved around the idea of sorting numbers. In our case the algorithm we specifically chose to implement is the “Heapsort” algorithm. The heap sort algorithm functions by creating a heap in which every node of the heap has two child nodes. At each step, a comparison is made between two levels and the larger number is moved towards the top of the heap. When all comparisons are made, the top of the heap is the max number. That number is extracted and the entire comparison process repeats until the heap is empty. At the end we have a sorted list of numbers in ascending order (Max-Heap). The heap sort algorithm does not require recursion but rather is an in-place algorithm. For large data sets the heap sort algorithm is ideal because it does not require massive recursion and can function with just a single array. As a result, the worst case running time for heap sort is O(n* log 2 (n)). The equipment necessary for this project included a PC and a DSKPlus board (DSP). The software that we used to generate a model of the heap sort algorithm was in C++. We used this source code to translate the code from “C” to assembly language as to be read into the DSP board. We did not have a previous project to work from; as a result we coded our project on our own. Project Development: The first step of the project was to decide what to implement. The motivation for picking a sorting algorithm is because how widely used sorting is in all kinds of applications. We felt that an efficient sorting algorithm, especially when implemented on the assembly level (when time efficiency is even more important) would be a great project to do. Also, a fast sorting algorithm has never been proposed and attempted by previous classes, so we thought it is unique as well. After deciding on the project, the next step was to model our project with a high level language (either Matlab or C) and try to convert the code using assembly language. There are a lot of resources on the internet on the topics of heap sorting, thus finding an efficient C model for our project was rather easy. We decided to use a model that would sort an array of numbers (the array size is correctly at 100 and with integer as inputs,
however, these parameters can be easily modified to fit all types and sizes of data) in ascending order. This required us to build a Max-Heap, and extract the maximum item on the heap every time and reconstruct the remaining items to abide by the heap order again. The C code for this step is rather straightforward, basically given an array of numbers, there will be a loop that handles constructing a max-heap. The definition of a Max-Heap is a binary tree which follows the heap order that the children is always less than the parent, and the root of the tree is always the maximum element of the array. The binary

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern