Skip to content

Nishchz/Quick-Sort-Algorthm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

52 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“– Ouick Sort Using Divide And Conquer (java)

This repository contains a clean implementation of Ouick Sort using the Divide And Conquer approach in java

🧾 INTRODUCTION

Quick Sort is one of the most efficient sorting algorithms and works by selecting a pivot elements partitioning the array around the pivot and recursively sorting the subarrays .

🧠 How Ouick Sort Works

  1. Choose a pivot elements ( here the last elements of the array )
  2. Partion the array so that :
    • Elements smaller than the pivot come to the left
    • Elements greater than the pivot come to the right
  3. Recursively apply Quick Sort on :
    • Left Subarray
    • Right Subarray

πŸ‘©β€πŸ’» Function Explained

  • Quick sort (int arr[] ,int si,int ei)
  • Recursively sorts the array
    • si-> starting index
    • ei-> ending index
  • Partition (int arr[],int si,int ei)
    • Place the pivot elements at its correct position
    • Rearrange elements smaller than pivot to the left
    • Returns the pivot index
  • PrintArray(int arr[])
    • Prints the sorted array

About

Quick Sort Algo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages