Skip to content

Conversation

@manikanta-manii
Copy link

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant