serverx-org / DSA-MASTERY

This repository covers the roadmap for mastering Data Structures and Algorithms in JavaScript, Python, C/C++, and Java.
https://serverx.org.in/articles/dsa-mastery/
12 stars 16 forks source link

Quick Sort Algo in c++ #60

Closed Shoaib237124 closed 3 weeks ago

Shoaib237124 commented 3 weeks ago

Quick Sort is a divide-and-conquer sorting algorithm that picks a "pivot" element, partitions the array around the pivot so that elements less than the pivot are on the left and elements greater are on the right, and then recursively sorts the sub-arrays. It has an average time complexity of 𝑂 ( 𝑛 log ⁡ 𝑛 ) O(nlogn) but can degrade to 𝑂 ( 𝑛 2 ) O(n 2 ) in the worst case if the pivot choices are unbalanced.

36

Shoaib237124 commented 3 weeks ago

@gautamankoji kindly review my PR for hacktoberfest