Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update quick-sort.md #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on May 17, 2023

  1. Update quick-sort.md

    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 authored May 17, 2023
    Configuration menu
    Copy the full SHA
    e0bde66 View commit details
    Browse the repository at this point in the history