Skip to content

Create Quick_sort.cpp - #4

Open
rajchaudhary99 wants to merge 1 commit into
avani112:mainfrom
rajchaudhary99:patch-1
Open

Create Quick_sort.cpp#4
rajchaudhary99 wants to merge 1 commit into
avani112:mainfrom
rajchaudhary99:patch-1

Conversation

@rajchaudhary99

Copy link
Copy Markdown

Quicksort Algorithm
Quicksort is a sorting algorithm based on the divide and conquer approach where

An array is divided into subarrays by selecting a pivot element (element selected from the array). While dividing the array, the pivot element should be positioned in such a way that elements less than pivot are kept on the left side and elements greater than pivot are on the right side of the pivot. The left and right subarrays are also divided using the same approach. This process continues until each subarray contains a single element. At this point, elements are already sorted. Finally, elements are combined to form a sorted array.

Quicksort Algorithm
Quicksort is a sorting algorithm based on the divide and conquer approach where

An array is divided into subarrays by selecting a pivot element (element selected from the array).

While dividing the array, the pivot element should be positioned in such a way that elements less than pivot are kept on the left side and elements greater than pivot are on the right side of the pivot.
The left and right subarrays are also divided using the same approach. This process continues until each subarray contains a single element.
At this point, elements are already sorted. Finally, elements are combined to form a sorted array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant