# Spushbackarri arrj review problem 5 show how to h

This preview shows pages 7–10. Sign up to view the full content.

s.push_back(arr[i] * arr[j]);

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

View Full Document
Review Problem #5 Show how to h-sort the following array for an h value of 4, in ascending order.   In each row below, show the resulting array after a single pass through the h-sort  algorithm. You may not need to use all 5 rows. 15 -3 12 0 2 0 9 3 7 2 6 5
Review Problem #6 Given the following unsorted array of integers, show it after it has been heapified using  the efficient heap-sort algorithm that performs heapification in-place. 6 16 3 19 13 72 13 12 99

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

View Full Document
Review Problem #7 You need to sort an array of integers which is already almost entirely sorted.   Should you use the insertion sort, the merge sort, or the heapsort?  You need to build a table to quickly look up student records by the students’  last names; the set of students will grow and shrink each year as new  students are enrolled and others graduate. Should you use a sorted array, a  closed hash table, or a binary search tree?  You will be inserting the items from an open hash table into a binary search  tree. In order to prevent the binary search tree from becoming pathologically  unbalanced, what’s the simplest binary search tree implementation you should  use? An AVL tree or an unbalanced binary search tree?
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