UnderstandingSofDevel.pdf

# UnderstandingSofDevel.pdf - 361 Lesson 3 Understanding...

• 12

This preview shows page 1 - 5 out of 12 pages.

Subscribe to view the full document.

6. Answer: a Difficulty: Medium Section Reference: Understanding QuickSort After you partition the array, you need only to sort the left and right sides of the array. The middle element is automatically sorted. To sort the left array, use the expression QuickSort( numbers, left, pivotIndex - 1); to sort the right array, you should use the expression QuickSort(numbers, pivotIndex + 1, right)).: 16. You are developing a sorting algorithm that uses partitioning and comparison to arrange an array of numbers in the correct order. You write a method that partitions the array so that the items less than pivot go to the left side, whereas the items greater than pivot go to the right side. The partitioning method has the following signature: static int Partition (int[] numbers, int left, int right, int pivotIndex) Which of the following algorithms should you use to sort the array using the Partition method?

Subscribe to view the full document.

• Spring '16
• Antin

{[ snackBarMessage ]}

###### "Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

### 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