menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Find posit...
source image

Prodevelopertutorial

1w

read

295

img
dot

Find position of an element in an Infinite Sorted Array

  • To search for an element in an infinite sorted array, we can use binary search.
  • However, to apply binary search, we need to find the end index.
  • To find the end index in an infinite array, we can start with a starting index and double the end index until we find an element greater than the key element.
  • Once we have the start and end indexes, we can apply binary search to find the key element's position.

Read Full Article

like

17 Likes

For uninterrupted reading, download the app