1. National Institute of Textile Engineering & Research
Department of Computer Science and Engineering
Course title: Data Structure and Algorithms
Course code: CSE 1201
Submitted by : Submitted to
Name : Samiul Hasan
ID: CS 2102013
Anichur Rahman
Lecturer , NITER
2. Quick Sort
CONTENTS
• What is Quick Sort
• Algorithm
• Working procedure at a glance
• Pseudocode
• Divide-and-conqure procedure
• Conclusion
3. What is Quick Sort
Quick sort is a sorting algorithm that uses the divide-and-conquer
strategy to sort an array by partitioning it into two sub-arrays and
recursively sorting them.
4. Algorithm
Given an array of n elements (e.g., integers):
• If array only contains one element, return
• Else
• pick one element to use as pivot.
• Partition elements into two sub-arrays:
• Elements less than or equal to pivot
• Elements greater than pivot
Quicksort two sub-arrays
18. Conclusion
Quick Sort is a widely used sorting algorithm that follows the divide-and-conquer approach,
recursively dividing the input array into two smaller sub-arrays and sorting them based on a
chosen pivot element. It has an average time complexity of O(nlogn) and is often faster in
practice than other popular sorting algorithms like Merge Sort and Heap Sort.