Salesforce| Virtual Interview 1 | USA | Search in Array with unknown length
Anonymous User
939

I got this question in one of my virtual rounds, where I am given a sorted array, and I have to find a target in log(n) time complexity. The only caveat is, I don't have access to the length of that array. I cannot use arr.length.

Its similar to https://leetcode.com/problems/search-in-a-sorted-array-of-unknown-size/, but here the method is taking ArrayReader, but in this question we are given the complete array. Any idea how to establish right boundary without overflowing?

Comments (3)