Skip to content

Instantly share code, notes, and snippets.

@YassineBajdou
Created January 11, 2019 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YassineBajdou/d59a111b856943f5da15dded52f910b8 to your computer and use it in GitHub Desktop.
Save YassineBajdou/d59a111b856943f5da15dded52f910b8 to your computer and use it in GitHub Desktop.
The recursive function Quick_sort
void quick_sort ( int A[ ] ,int start , int end ) {
if( start < end ) {
//stores the position of pivot element
int piv_pos = partition (A,start , end ) ;
quick_sort (A,start , piv_pos -1); //sorts the left side of pivot.
quick_sort ( A,piv_pos +1 , end) ; //sorts the right side of pivot.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment