source icon indicating copy to clipboard operation
source copied to clipboard

Update quick-sort.md

Open manikanta-manii opened this issue 2 years ago • 0 comments

Previous code was having Array Index Bound Error in it , so i made changes in code . Changes made are:

  1. 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

manikanta-manii avatar May 17 '23 19:05 manikanta-manii