Skip to content

Commit

Permalink
Update Segment_Tree.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-Morpheus authored Oct 6, 2023
1 parent d3a56a3 commit b2d4476
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Computational_Algorithms/Trees/Segment_Tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ int main(){
cout<<"value of range minimum index and maximum index"<<endl;
int l,r;
cin>>l>>r;
if(l<0){
cout<<"out of index";
if(l<0||r>n-1){
cout<<"out of index please keep input in array range";
return 0;
}
int result=find(0,0,n-1,l,r);//to find the min/max value in a given range.
Expand Down

0 comments on commit b2d4476

Please sign in to comment.