8/7/22, 1:34 AM
CS 3303-01 - AY2022-T5: Discussion Forum-Unit 6
CS 3303-01 Data Structures - AY2022-T5
Dashboard / My courses / CS 3303-01 - AY2022-T5 / 21 July - 27 July / _Discussion Forum Unit 6 /_Discussion Forum-Unit 6
0
Search forums
Discussion Forum Unit 6
Discussion Forum-Unit 6
# Settings
Display replies in nested form
The cut-off date for posting to this forum is reached so you can no longer post to it.
Discussion Forum-Unit 6 by Rupali Memane (Instructor) - Tuesday, 14 June 2022, 10:34 AM
Discussion Assignment
The quicksort is an example of a divide and conquer algorithm in that it divides the sorting problem into smaller problems by dividing the list of items to be sorted into smaller subsets. The pivot is the mechanism that is used to segment the list. Describe how the quicksort works including a discussion of the pivot, how it is selected, and why the pivot is important to the quicksort.
71 words
Permalink
Re: Discussion Forum-Unit 6 by Victor Ezekiel - Friday, 22 July 2022, 8:29 PM
The quicksort is an example of a divide and conquers algorithm in that it divides the sorting problem into smaller problem by dividing the list of items to be sorted into smaller subsets. The pivot is the mechanism that is used to segment the list Describe how the quicksort works including a discussion of the pivot, how it is selected, and why the pivot is important to the quicksort
Using the phrase divide and conquer is enough for one to understand exactly what quicksort is all about. It is a type of sortin method that picks up an element of an array and uses it as a pivot (In this case, as the point of contact for dividing) to
quicksort, picking a pivot might tend to differ as some ways to pick a pivot in an array includes: 1. By picking up a random element in the array. 2. Picking the first element in the array. 3. picking the last element in the array. 4. Or by picking the middle element of an array.
The term divides and conquer is used for this type of sorting due to how it operates after choosing a pivot from the array. Aft declaring the pivot, the algorithm for this sorting method tends to divide the whole array into two parts in a way that allows tr elements on the left side of the pivot to be smaller than the pivot while the elements on the left side will be bigger than the pivot. Personally, I believe it normally goes through 4 major process which includes: 1. Finding the pivot that can be used to divide the algorithm
https://my.uopeople.edu/mod/forum/discuss.php?d=808767
1/41
8/7/22, 1:34 AM
CS 3303-01 - AY2022-T5: Discussion Forum-Unit 6
2. Sorting the left half of the pivot 3. sorting the right half of the pivot 4. Ensuring that all elements are carefully sorted in the right place before quitting.
Quick Sort Algorithm
12
I think it