Created
January 11, 2019 11:05
-
-
Save YassineBajdou/d59a111b856943f5da15dded52f910b8 to your computer and use it in GitHub Desktop.
The recursive function Quick_sort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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