source
source copied to clipboard
Update quick-sort.md
Previous code was having Array Index Bound Error in it , so i made changes in code . Changes made are:
- pointer i was incrementing if arr[i] is less than or equal to pivot this was leading it cross the boundary , which is at that iteration i will be greater than high . then again while checking condition it was trying to access the high'th element which was giving "Array Index Out Of Bound" error . solution : if ( i<=high && arr[i] <=pivot ) then i++ ;
similarly for j pointer : if(j>=low && arr[j] >=pivot) then j-- ;
📌📌 please update this in your web page ........ ❤️❤️ If possible give some credit :
https://github.com/manikanta-manii