DSA-Bootcamp-Java icon indicating copy to clipboard operation
DSA-Bootcamp-Java copied to clipboard

Update InfiniteArray.java

Open tamannasgh opened this issue 3 years ago • 1 comments

if the target is larger than the largest element in the array it will not lie between the last range and when the while loop run again it will compare the target with the unexisting index of the array and will through index out of bond error.

tamannasgh avatar Jan 16 '22 14:01 tamannasgh

If target is lie in array but due to end pointer points to unexisting index of array then we have to move end pointer to last element of array i.e end = arr.lengtn -1 . IMG_20220126_133404

kamya-creator avatar Jan 26 '22 08:01 kamya-creator